changeset 3004:bfd2b1ef907c

[gaim-migrate @ 3017] Don't fork for console beeps anymore. Fixed a bug reported by Mike Owens. committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Mon, 04 Mar 2002 18:43:27 +0000
parents 2a1bae4efb92
children 00ce285e3ed1
files src/gtkimhtml.c src/sound.c
diffstat 2 files changed, 14 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkimhtml.c	Mon Mar 04 17:22:57 2002 +0000
+++ b/src/gtkimhtml.c	Mon Mar 04 18:43:27 2002 +0000
@@ -2898,7 +2898,7 @@
 		*length = 5;
 	} else if (*(string + 1) == '#') {
 		guint pound = 0;
-		if (sscanf (string, "&#%u;", &pound) == 1) {
+		if ((sscanf (string, "&#%u;", &pound) == 1) && pound != 0) {
 			if (*(string + 3 + (gint)log10 (pound)) != ';')
 				return FALSE;
 			*replace = (gchar)pound;
--- a/src/sound.c	Mon Mar 04 17:22:57 2002 +0000
+++ b/src/sound.c	Mon Mar 04 18:43:27 2002 +0000
@@ -391,17 +391,18 @@
 	return;
 #endif
 
+	if (sound_options & OPT_SOUND_BEEP) {
+		gdk_beep();
+		return;
+	}
+
 	pid = fork();
 
 	if (pid < 0)
 		return;
 	else if (pid == 0) {
 		alarm(30);
-		if (sound_options & OPT_SOUND_BEEP) {
-			gdk_beep();
-			_exit(0);
-		}
-
+		
 		if (sound_cmd[0]) {
 			char *args[4];
 			char command[4096];
@@ -455,20 +456,21 @@
 	return;
 #endif
 
+	if (sound_options & OPT_SOUND_BEEP) {
+		gdk_beep();
+		return;
+	}
 	pid = fork();
-
+	
 	if (pid < 0)
 		return;
 	else if (pid == 0) {
 		alarm(30);
-		if (sound_options & OPT_SOUND_BEEP) {
-			gdk_beep();
-			_exit(0);
-		}
+		
 #ifdef ESD_SOUND
 		/* ESD is our player of choice.  Are we OK to
 		 * go there? */
-		else if (sound_options & OPT_SOUND_ESD) {
+		if (sound_options & OPT_SOUND_ESD) {
 			if (can_play_esd()) {
 				if (play_esd(data, size))
 					_exit(0);