From: Sergey Poznyakoff Date: Sat, 14 Oct 2006 10:45:44 +0000 (+0000) Subject: (_open_archive): Make sure stdlis is set to stderr X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=dc6f7ebf20934b0d9975b0129b9d4c370d1d29bc;p=chaz%2Ftar (_open_archive): Make sure stdlis is set to stderr when we are writing archive to stdout (unless --index-file is used). Bug introduced on 2006-07-06. --- diff --git a/src/buffer.c b/src/buffer.c index 57b2715..50b4749 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -474,6 +474,11 @@ _open_archive (enum access_mode wanted_access) abort (); /* Should not happen */ break; } + + if (!index_file_name + && wanted_access == ACCESS_WRITE + && strcmp (archive_name_array[0], "-") == 0) + stdlis = stderr; } else if (strcmp (archive_name_array[0], "-") == 0) { @@ -499,12 +504,16 @@ _open_archive (enum access_mode wanted_access) case ACCESS_WRITE: archive = STDOUT_FILENO; + if (!index_file_name) + stdlis = stderr; break; case ACCESS_UPDATE: archive = STDIN_FILENO; write_archive_to_stdout = true; record_end = record_start; /* set up for 1st record = # 0 */ + if (!index_file_name) + stdlis = stderr; break; } }