From 4cccbd74e645c2d8b5d6ce83ca4efd3da9eee189 Mon Sep 17 00:00:00 2001 From: "K. Noel Belcourt" Date: Sat, 30 Jun 2012 05:40:36 +0000 Subject: [PATCH] Fix bug where process jam log could not find command status when max buffer not size not unlimited and buffer full. Change character before buffer null terminator to be a newline so command status appears on its own line. [SVN r79184] --- v2/engine/execunix.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/v2/engine/execunix.c b/v2/engine/execunix.c index cd3fc6974..5ded8f168 100644 --- a/v2/engine/execunix.c +++ b/v2/engine/execunix.c @@ -335,6 +335,14 @@ static int read_descriptor( int i, int s ) } } + /* If buffer full, ensure last buffer char is newline + * so process jam log finds command status at beginning + * of it own line, not appended to end of buffer output. + */ + if ( globs.max_buf && cmdtab[i].buf_size[s] == globs.max_buf ) { + cmdtab[i].buffer[s][cmdtab[i].buf_size[s]-2] = '\n'; + } + return feof( cmdtab[ i ].stream[ s ] ); }