X-Git-Url: http://hgm.nubati.net/cgi-bin/gitweb.cgi?p=xboard.git;a=blobdiff_plain;f=usystem.c;h=0d0a84723309fee3ec3bf99ccb8f0e6ecd6f1283;hp=4a08e576d56bed1cbfebb439365618a480a9a85d;hb=6bead4fda35db0cb9ec61309ee7cd9c99bb53475;hpb=89b07e580a401d8c123c4a10e82789a873f37965 diff --git a/usystem.c b/usystem.c index 4a08e576..0d0a8472 100644 --- a/usystem.c +++ b/usystem.c @@ -5,7 +5,7 @@ * 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 Free Software Foundation, Inc. * * The following terms apply to Digital Equipment Corporation's copyright * interest in XBoard: @@ -650,18 +650,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);