If filename is a '-' then read from stdin to stdout

This commit is contained in:
Glenn L McGrath 2001-07-30 04:48:50 +00:00
parent 14d7ea460f
commit 7499918f30
2 changed files with 2 additions and 2 deletions

View 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;
}

2
gzip.c
View 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;
}