o more check for NULLs
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Fri, 2 Aug 2002 22:20:30 +0000 (22:20 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Fri, 2 Aug 2002 22:20:30 +0000 (22:20 +0000)
o put create_io_dialog() in right conditional block

ChangeLog.claws
configure.in
src/prefs_actions.c

index 98c83122d6ccd4c2945b800f441cf83a5b1599f6..77f5fdac8d6bcc7cecf838d6519bc6a9cad4012b 100644 (file)
@@ -1,3 +1,9 @@
+2002-08-02 [alfons]    0.8.1claws11
+
+       * src/prefs_actions.c
+               o more check for NULLs
+               o put create_io_dialog() in right conditional block
+
 2002-08-02 [paul]      0.8.1claws10
 
        * po/es.po
index 6f653a5cd1cd844a7a70c899434928189869afc2..ee3d7cb7a41edf9d2021c2fe65eac67073d4461c 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws10
+EXTRA_VERSION=claws11
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 21488ccc4b8b67f273d30a4e068547199bfdcb7e..11338ef3ee129d4854d4ea2cef50aca45a5396fc 100644 (file)
@@ -1205,15 +1205,16 @@ static gboolean execute_actions(gchar *action, GtkWidget *window,
 
                for (cur = children_list; cur; cur = cur->next) {
                        child_info = (ChildInfo *) cur->data;
-                       child_info->tag_status = 
-                               gdk_input_add(child_info->chld_status,
-                                             GDK_INPUT_READ,
-                                             catch_status, child_info);
+                       if (child_info) 
+                               child_info->tag_status = 
+                                       gdk_input_add(child_info->chld_status,
+                                                     GDK_INPUT_READ,
+                                                     catch_status, child_info);
                }
+               
+               create_io_dialog(children);
        }
 
-       create_io_dialog(children);
-
        return is_ok;
 }
 
@@ -1414,11 +1415,15 @@ static void kill_children_cb(GtkWidget *widget, gpointer data)
        Children *children = (Children *) data;
        ChildInfo *child_info;
 
+       g_return_if_fail(data);
+
        for (cur = children->list; cur; cur = cur->next) {
-               child_info = (ChildInfo *)(cur->data);
-               debug_print(_("Killing child group id %d\n"), child_info->pid);
-               if (child_info->pid && kill(-child_info->pid, SIGTERM) < 0)
-                       perror("kill");
+               child_info = (ChildInfo *) (cur->data);
+               if (child_info) {
+                       debug_print(_("Killing child group id %d\n"), child_info->pid);
+                       if (child_info->pid && kill(-child_info->pid, SIGTERM) < 0)
+                               perror("kill");
+               }                               
        }
 }
 
@@ -1436,9 +1441,11 @@ static gint wait_for_children(gpointer data)
        new_output = FALSE;
        while (cur) {
                child_info = (ChildInfo *)cur->data;
-               if (child_info->pid)
-                       children->nb++;
-               new_output |= child_info->new_out;
+               if (child_info) {
+                       if (child_info->pid)
+                               children->nb++;
+                       new_output |= child_info->new_out;
+               }                       
                cur = cur->next;
        }
 
@@ -1481,6 +1488,8 @@ static void hide_io_dialog_cb(GtkWidget *w, gpointer data)
 
        Children *children = (Children *)data;
 
+       g_return_if_fail(children);
+
        if (!children->nb) {
                gtk_signal_disconnect_by_data(GTK_OBJECT(children->dialog),
                                              children);
@@ -1513,11 +1522,15 @@ static void free_children(Children *children)
        g_free(children->action);
        for (cur = children->list; cur;) {
                child_info = (ChildInfo *)cur->data;
-               g_free(child_info->cmd);
-               g_string_free(child_info->output, TRUE);
-               children->list = g_slist_remove(children->list, child_info);
-               g_free(child_info);
-               cur = children->list;
+               if (child_info) {
+                       g_free(child_info->cmd);
+                       g_string_free(child_info->output, TRUE);
+                       children->list = g_slist_remove(children->list, child_info);
+                       g_free(child_info);
+                       cur = children->list;
+               } else {
+                       break; /* ??? */
+               }
        }
        g_free(children);
 }
@@ -1547,21 +1560,23 @@ static void update_io_dialog(Children *children)
                                        gtk_text_get_length(GTK_TEXT(text)));
                for (cur = children->list; cur; cur = cur->next) {
                        child_info = (ChildInfo *)cur->data;
-                       if (child_info->pid)
-                               caption = g_strdup_printf
-                                       (_("--- Running: %s\n"),
-                                        child_info->cmd);
-                       else
-                               caption = g_strdup_printf
-                                       (_("--- Ended: %s\n"),
-                                        child_info->cmd);
-
-                       gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL,
-                                       caption, -1);
-                       gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL,
-                                       child_info->output->str, -1);
-                       g_free(caption);
-                       child_info->new_out = FALSE;
+                       if (child_info) {
+                               if (child_info->pid)
+                                       caption = g_strdup_printf
+                                               (_("--- Running: %s\n"),
+                                                child_info->cmd);
+                               else
+                                       caption = g_strdup_printf
+                                               (_("--- Ended: %s\n"),
+                                                child_info->cmd);
+
+                               gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL,
+                                               caption, -1);
+                               gtk_text_insert(GTK_TEXT(text), NULL, NULL, NULL,
+                                               child_info->output->str, -1);
+                               g_free(caption);
+                               child_info->new_out = FALSE;
+                       }       
                }
                gtk_text_thaw(GTK_TEXT(text));
        }