If filename is a '-' then read from stdin to stdout
authorGlenn L McGrath <bug1@ihug.co.nz>
Mon, 30 Jul 2001 04:48:50 +0000 (04:48 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Mon, 30 Jul 2001 04:48:50 +0000 (04:48 -0000)
archival/gzip.c
gzip.c

index cdf22688924ebd9dfefddc1b4ac434dd39d4d56c..54bb727455d2252dbd440f0449128a4e1da3f1e9 100644 (file)
@@ -1246,7 +1246,7 @@ int gzip_main(int argc, char **argv)
                        show_usage();
                }
        }
-       if (optind == argc) {
+       if ((optind == argc) || (strcmp(argv[optind], "-") == 0)) {
                fromstdin = 1;
                tostdout = 1;
        }
diff --git a/gzip.c b/gzip.c
index cdf22688924ebd9dfefddc1b4ac434dd39d4d56c..54bb727455d2252dbd440f0449128a4e1da3f1e9 100644 (file)
--- a/gzip.c
+++ b/gzip.c
@@ -1246,7 +1246,7 @@ int gzip_main(int argc, char **argv)
                        show_usage();
                }
        }
-       if (optind == argc) {
+       if ((optind == argc) || (strcmp(argv[optind], "-") == 0)) {
                fromstdin = 1;
                tostdout = 1;
        }