diff options
-rw-r--r-- | archival/gzip.c | 7 | ||||
-rw-r--r-- | gzip.c | 7 |
2 files changed, 6 insertions, 8 deletions
diff --git a/archival/gzip.c b/archival/gzip.c index 591b8cc7f..c0832680f 100644 --- a/archival/gzip.c +++ b/archival/gzip.c | |||
@@ -1802,9 +1802,6 @@ int gzip_main(int argc, char **argv) | |||
1802 | int fromstdin = 0; | 1802 | int fromstdin = 0; |
1803 | int force = 0; | 1803 | int force = 0; |
1804 | 1804 | ||
1805 | if (argc == 1) | ||
1806 | usage(gzip_usage); | ||
1807 | |||
1808 | /* Parse any options */ | 1805 | /* Parse any options */ |
1809 | while (--argc > 0 && **(++argv) == '-') { | 1806 | while (--argc > 0 && **(++argv) == '-') { |
1810 | if (*((*argv) + 1) == '\0') { | 1807 | if (*((*argv) + 1) == '\0') { |
@@ -1827,8 +1824,10 @@ int gzip_main(int argc, char **argv) | |||
1827 | } | 1824 | } |
1828 | } | 1825 | } |
1829 | } | 1826 | } |
1830 | if (argc <= 0) | 1827 | if (argc <= 0 ) { |
1831 | fromstdin = 1; | 1828 | fromstdin = 1; |
1829 | tostdout = 1; | ||
1830 | } | ||
1832 | 1831 | ||
1833 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) | 1832 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) |
1834 | fatalError( "data not read from terminal. Use -f to force it.\n"); | 1833 | fatalError( "data not read from terminal. Use -f to force it.\n"); |
@@ -1802,9 +1802,6 @@ int gzip_main(int argc, char **argv) | |||
1802 | int fromstdin = 0; | 1802 | int fromstdin = 0; |
1803 | int force = 0; | 1803 | int force = 0; |
1804 | 1804 | ||
1805 | if (argc == 1) | ||
1806 | usage(gzip_usage); | ||
1807 | |||
1808 | /* Parse any options */ | 1805 | /* Parse any options */ |
1809 | while (--argc > 0 && **(++argv) == '-') { | 1806 | while (--argc > 0 && **(++argv) == '-') { |
1810 | if (*((*argv) + 1) == '\0') { | 1807 | if (*((*argv) + 1) == '\0') { |
@@ -1827,8 +1824,10 @@ int gzip_main(int argc, char **argv) | |||
1827 | } | 1824 | } |
1828 | } | 1825 | } |
1829 | } | 1826 | } |
1830 | if (argc <= 0) | 1827 | if (argc <= 0 ) { |
1831 | fromstdin = 1; | 1828 | fromstdin = 1; |
1829 | tostdout = 1; | ||
1830 | } | ||
1832 | 1831 | ||
1833 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) | 1832 | if (isatty(fileno(stdin)) && fromstdin==1 && force==0) |
1834 | fatalError( "data not read from terminal. Use -f to force it.\n"); | 1833 | fatalError( "data not read from terminal. Use -f to force it.\n"); |