diff options
author | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-09-01 00:33:06 +0000 |
---|---|---|
committer | andersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2000-09-01 00:33:06 +0000 |
commit | bbc56159e186cc3a9dc5e991e24661ae17768b31 (patch) | |
tree | ff1913934c43477a589140b63083985afb449b8e /gzip.c | |
parent | 7d4e689c6a584878e762a93bfa94317707b455ef (diff) | |
download | busybox-w32-bbc56159e186cc3a9dc5e991e24661ae17768b31.tar.gz busybox-w32-bbc56159e186cc3a9dc5e991e24661ae17768b31.tar.bz2 busybox-w32-bbc56159e186cc3a9dc5e991e24661ae17768b31.zip |
Sigh. Seems I screwed up last time. This fixed detecting
when on a console or not, and make default behavior compatible
with GNU gzip...
-Erik
git-svn-id: svn://busybox.net/trunk/busybox@990 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'gzip.c')
-rw-r--r-- | gzip.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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"); |