Fix from Robert Kaiser for stdin behavior.
authorEric Andersen <andersen@codepoet.org>
Fri, 28 Jul 2000 15:20:24 +0000 (15:20 -0000)
committerEric Andersen <andersen@codepoet.org>
Fri, 28 Jul 2000 15:20:24 +0000 (15:20 -0000)
 -Erik

archival/tar.c
tar.c

index 6f18dc43f3cef240e3c0596f8802899b9962cbff..3227ce5bdb71b50a98323bd2366b67d871c8954c 100644 (file)
@@ -167,7 +167,7 @@ extern int tar_main(int argc, char **argv)
                                        tarName = *(++argv);
                                        if (tarName == NULL)
                                                fatalError( "Option requires an argument: No file specified\n");
-                                       if (!strcmp(tarName, "-"))
+                                       if (!strcmp(tarName, "-") && createFlag == TRUE)
                                                tostdoutFlag = TRUE;
                                        stopIt=TRUE;
                                        break;
diff --git a/tar.c b/tar.c
index 6f18dc43f3cef240e3c0596f8802899b9962cbff..3227ce5bdb71b50a98323bd2366b67d871c8954c 100644 (file)
--- a/tar.c
+++ b/tar.c
@@ -167,7 +167,7 @@ extern int tar_main(int argc, char **argv)
                                        tarName = *(++argv);
                                        if (tarName == NULL)
                                                fatalError( "Option requires an argument: No file specified\n");
-                                       if (!strcmp(tarName, "-"))
+                                       if (!strcmp(tarName, "-") && createFlag == TRUE)
                                                tostdoutFlag = TRUE;
                                        stopIt=TRUE;
                                        break;