Handle -O preceding -x.
authorMatt Kraai <kraai@debian.org>
Sun, 18 May 2003 21:12:36 +0000 (21:12 -0000)
committerMatt Kraai <kraai@debian.org>
Sun, 18 May 2003 21:12:36 +0000 (21:12 -0000)
archival/tar.c
testsuite/tar/tar-extracts-to-standard-output [new file with mode: 0644]

index 00f9f87af7925e0fedd27cee976bb8975c4b09a6..29244d4bf72a1502917da6add5ab6ac300f6e701 100644 (file)
@@ -645,7 +645,9 @@ int tar_main(int argc, char **argv)
                        break;
                case 'x':
                        ctx_flag |= CTX_EXTRACT;
-                       tar_handle->action_data = data_extract_all;
+                       if (tar_handle->action_data != data_extract_to_stdout) {
+                               tar_handle->action_data = data_extract_all;
+                       }
                        break;
 
                        /* These are optional */
diff --git a/testsuite/tar/tar-extracts-to-standard-output b/testsuite/tar/tar-extracts-to-standard-output
new file mode 100644 (file)
index 0000000..ca48e36
--- /dev/null
@@ -0,0 +1,3 @@
+echo foo > foo
+tar cf foo.tar foo
+cat foo.tar | busybox tar Ox | cmp foo -