summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--archival/gzip.c2
-rw-r--r--gzip.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/archival/gzip.c b/archival/gzip.c
index cdf2268..54bb727 100644
--- a/archival/gzip.c
+++ b/archival/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;
}
diff --git a/gzip.c b/gzip.c
index cdf2268..54bb727 100644
--- 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;
}