← Commit list

ef8b112d7

Matt Kraai
Matt Kraai
2002-03-22
TIMEOUT Duration: 620s

Subject

* archival/gzip.c (gzip_main): Ensure that the output is a terminal and use error_msg to display the error message.

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

archival/gzip.c+2 -2
@@ -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;
}