summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen2000-09-01 00:33:06 +0000
committerEric Andersen2000-09-01 00:33:06 +0000
commit5eb5912790b32df1dcf3ed91652d0c373c735bb0 (patch)
treeff1913934c43477a589140b63083985afb449b8e
parent4e61db228496a1ef1b81773d41116ebb659cebe3 (diff)
downloadbusybox-5eb5912790b32df1dcf3ed91652d0c373c735bb0.zip
busybox-5eb5912790b32df1dcf3ed91652d0c373c735bb0.tar.gz
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
-rw-r--r--archival/gzip.c7
-rw-r--r--gzip.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/archival/gzip.c b/archival/gzip.c
index 591b8cc..c083268 100644
--- a/archival/gzip.c
+++ b/archival/gzip.c
@@ -1802,9 +1802,6 @@ int gzip_main(int argc, char **argv)
int fromstdin = 0;
int force = 0;
- if (argc == 1)
- usage(gzip_usage);
-
/* Parse any options */
while (--argc > 0 && **(++argv) == '-') {
if (*((*argv) + 1) == '\0') {
@@ -1827,8 +1824,10 @@ int gzip_main(int argc, char **argv)
}
}
}
- if (argc <= 0)
+ if (argc <= 0 ) {
fromstdin = 1;
+ tostdout = 1;
+ }
if (isatty(fileno(stdin)) && fromstdin==1 && force==0)
fatalError( "data not read from terminal. Use -f to force it.\n");
diff --git a/gzip.c b/gzip.c
index 591b8cc..c083268 100644
--- a/gzip.c
+++ b/gzip.c
@@ -1802,9 +1802,6 @@ int gzip_main(int argc, char **argv)
int fromstdin = 0;
int force = 0;
- if (argc == 1)
- usage(gzip_usage);
-
/* Parse any options */
while (--argc > 0 && **(++argv) == '-') {
if (*((*argv) + 1) == '\0') {
@@ -1827,8 +1824,10 @@ int gzip_main(int argc, char **argv)
}
}
}
- if (argc <= 0)
+ if (argc <= 0 ) {
fromstdin = 1;
+ tostdout = 1;
+ }
if (isatty(fileno(stdin)) && fromstdin==1 && force==0)
fatalError( "data not read from terminal. Use -f to force it.\n");