* archival/gzip.c (gzip_main): Ensure that the output is a terminal and use
error_msg to display the error message.
This commit is contained in:
parent
b88868276c
commit
ef8b112d77
@ -1312,8 +1312,8 @@ int gzip_main(int argc, char **argv)
|
|||||||
outFileNum = STDOUT_FILENO;
|
outFileNum = STDOUT_FILENO;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (path == NULL && force == 0) {
|
if (path == NULL && isatty(outFileNum) && force == 0) {
|
||||||
perror_msg("compressed data not written to a terminal. Use -f to force compression.");
|
error_msg("compressed data not written to a terminal. Use -f to force compression.");
|
||||||
free(path);
|
free(path);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user