From: Andre Noll Date: Fri, 3 Jan 2014 23:42:38 +0000 (+0000) Subject: gui: Reset command buf offset on errors. X-Git-Tag: v0.5.3~12^2~51 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=8ea82f861ae1dd0d842b1fe035d0b23d7b5d3ed7;p=paraslash.git gui: Reset command buf offset on errors. On read errors or EOF we close the pipe that corresponds to stdout/stderr of the current display command. However, we miss to reset the offset value of the command buffer in this case. If this offset was positive at the time the read error occurred, we skip the first part of the output of the next command. Fix this by always resetting the offset after closing the pipe. --- diff --git a/gui.c b/gui.c index 716e299b..2a0174b8 100644 --- a/gui.c +++ b/gui.c @@ -1054,6 +1054,7 @@ repeat: close(command_fds[i]); command_fds[i] = -1; flags[i] = 0; + cbo[i] = 0; if (command_fds[!i] < 0) /* both fds closed */ return 0; }