]> Dogcows Code - chaz/tar/commitdiff
(_open_archive): Make sure stdlis is set to stderr
authorSergey Poznyakoff <gray@gnu.org.ua>
Sat, 14 Oct 2006 10:45:44 +0000 (10:45 +0000)
committerSergey Poznyakoff <gray@gnu.org.ua>
Sat, 14 Oct 2006 10:45:44 +0000 (10:45 +0000)
when we are writing archive to stdout (unless --index-file is
used). Bug introduced on 2006-07-06.

src/buffer.c

index 57b271527ba3d4c64dbad00d04ba92ed9cfb44c2..50b474936939f0e606c8c2dc504581611ef09a00 100644 (file)
@@ -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;
        }
     }
This page took 0.025478 seconds and 4 git commands to generate.