Revision: 4949 http://geany.svn.sourceforge.net/geany/?rev=4949&view=rev Author: elextr Date: 2010-05-23 08:27:20 +0000 (Sun, 23 May 2010)
Log Message: ----------- Fix infinite loop reading build command output
Modified Paths: -------------- trunk/ChangeLog trunk/src/build.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2010-05-23 08:08:49 UTC (rev 4948) +++ trunk/ChangeLog 2010-05-23 08:27:20 UTC (rev 4949) @@ -1,3 +1,9 @@ +2010-05-23 Lex Trotman <elextr.at.gmail.dot.com> + + * src/build.c: + Fix infinite loop reading build command output + + 2010-05-23 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
* src/msgwindow.c:
Modified: trunk/src/build.c =================================================================== --- trunk/src/build.c 2010-05-23 08:08:49 UTC (rev 4948) +++ trunk/src/build.c 2010-05-23 08:27:20 UTC (rev 4949) @@ -1014,14 +1014,16 @@ if (cond & (G_IO_IN | G_IO_PRI)) { gchar *msg; + GIOStatus st;
- while (g_io_channel_read_line(ioc, &msg, NULL, NULL, NULL) && msg) + while ((st = g_io_channel_read_line(ioc, &msg, NULL, NULL, NULL)) == G_IO_STATUS_NORMAL && msg) { gint color = (GPOINTER_TO_INT(data)) ? COLOR_DARK_RED : COLOR_BLACK;
process_build_output_line(msg, color); g_free(msg); } + if (st == G_IO_STATUS_ERROR || st == G_IO_STATUS_EOF) return FALSE; } if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) return FALSE;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.