X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=usystem.c;h=a469fe780db47f920022e82f1fcecd17e6e95b19;hb=0278ebc80411a20fd23303156285e55ce8d2b0a5;hp=4a08e576d56bed1cbfebb439365618a480a9a85d;hpb=89b07e580a401d8c123c4a10e82789a873f37965;p=xboard.git diff --git a/usystem.c b/usystem.c index 4a08e57..a469fe7 100644 --- a/usystem.c +++ b/usystem.c @@ -5,7 +5,8 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free + * Software Foundation, Inc. * * The following terms apply to Digital Equipment Corporation's copyright * interest in XBoard: @@ -650,18 +651,20 @@ OpenRcmd (char *host, char *user, char *cmd, ProcRef *pr) return -1; } +Boolean stdoutClosed = FALSE; + int OutputToProcess (ProcRef pr, char *message, int count, int *outError) { static int line = 0; ChildProc *cp = (ChildProc *) pr; - int outCount; + int outCount = count; if (pr == NoProc) { - if (appData.noJoin || !appData.useInternalWrap) - outCount = fwrite(message, 1, count, stdout); - else + if (appData.noJoin || !appData.useInternalWrap) { + if(!stdoutClosed) outCount = fwrite(message, 1, count, stdout); + } else { int width = get_term_width(); int len = wrap(NULL, message, count, width, &line);