Make sure all user's input is sent to the action and then close the socket
authorMelvin Hadasht <melvin.hadasht@free.fr>
Mon, 24 Feb 2003 16:40:03 +0000 (16:40 +0000)
committerMelvin Hadasht <melvin.hadasht@free.fr>
Mon, 24 Feb 2003 16:40:03 +0000 (16:40 +0000)
ChangeLog.claws
configure.ac
src/prefs_actions.c

index e7c5db3c174a5d806d56e3ad441d0670d261b5ce..a96406234054f1f055fb45c215cf5fde1b70e5b2 100644 (file)
@@ -1,3 +1,9 @@
+2003-02-24 [melvin] 0.8.10claws48
+
+       * src/prefs_actions.c
+               Make sure all user's input is sent to the action and then
+               close the socket..
+
 2003-02-23 [alfons]
 
        * src/summaryview.c
index 2e0395061369b51fc3397f0368f2dc96b875599d..243763f5b1e62f2c89c5c9fcb9f9164253eb2b35 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=10
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws46
+EXTRA_VERSION=claws48
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 1de66a1a2d2685fa9977fd314d8d5b105a214439..1193b1eb94484ecf456d7fb5b8afab938cc5ab34 100644 (file)
@@ -1739,7 +1739,7 @@ static void catch_input(gpointer data, gint source, GdkInputCondition cond)
        Children *children = (Children *)data;
        ChildInfo *child_info = (ChildInfo *)children->list->data;
        gchar *input;
-       gint c;
+       gint c, count, len;
 
        debug_print("Sending input to grand child.\n");
        if (!(cond && GDK_INPUT_WRITE))
@@ -1750,14 +1750,25 @@ static void catch_input(gpointer data, gint source, GdkInputCondition cond)
 
        input = gtk_editable_get_chars(GTK_EDITABLE(children->input_entry),
                                       0, -1);
-       c = write(child_info->chld_in, input, strlen(input));
+       len = strlen(input);
+       count = 0;
+       
+       do {
+               c = write(child_info->chld_in, input + count, len - count);
+               if (c >= 0)
+                       count += c;
 
-       g_free(input);
+       } while (c >= 0 && count < len);
 
-       write(child_info->chld_in, "\n", 2);
+       if (c >= 0)
+               write(child_info->chld_in, "\n", 2);
+
+       g_free(input);
 
        gtk_entry_set_text(GTK_ENTRY(children->input_entry), "");
        gtk_widget_set_sensitive(children->input_hbox, TRUE);
+       close(child_info->chld_in);
+       child_info->chld_in = -1;
        debug_print("Input to grand child sent.\n");
 }