summaryrefslogtreecommitdiff
blob: e6dc7c6c0e24f8687c0fe9e664398758ca91db9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
http://bugs.gentoo.org/151239
http://lists.gnu.org/archive/html/bug-tar/2006-10/msg00018.html

2006-10-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	* src/buffer.c (_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.

Index: src/buffer.c
===================================================================
RCS file: /sources/tar/tar/src/buffer.c,v
retrieving revision 1.107
retrieving revision 1.108
diff --unified -B -b -r1.107 -r1.108
--- src/buffer.c	2 Oct 2006 15:44:09 -0000	1.107
+++ src/buffer.c	14 Oct 2006 10:45:44 -0000	1.108
@@ -474,6 +474,11 @@
 	  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 @@
 
 	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;
 	}
     }