From: Matt Kraai Date: Fri, 22 Mar 2002 22:55:51 +0000 (-0000) Subject: * archival/gzip.c (gzip_main): Ensure that the output is a terminal and use X-Git-Tag: 0_60_3~56 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ef8b112d77c3a05f17fa108d93d44d9a66902853;p=oweals%2Fbusybox.git * archival/gzip.c (gzip_main): Ensure that the output is a terminal and use error_msg to display the error message. --- diff --git a/archival/gzip.c b/archival/gzip.c index fed93907b..44b5fe386 100644 --- a/archival/gzip.c +++ b/archival/gzip.c @@ -1312,8 +1312,8 @@ int gzip_main(int argc, char **argv) outFileNum = STDOUT_FILENO; } - if (path == NULL && force == 0) { - perror_msg("compressed data not written to a terminal. Use -f to force compression."); + if (path == NULL && isatty(outFileNum) && force == 0) { + error_msg("compressed data not written to a terminal. Use -f to force compression."); free(path); continue; }