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 cdf2268..54bb727 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 cdf2268..54bb727 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;
        }