summaryrefslogtreecommitdiffstats
path: root/programs/lz4cli.c
diff options
context:
space:
mode:
authorWHR <msl0000023508@gmail.com>2021-12-14 06:06:52 (GMT)
committerWHR <msl0000023508@gmail.com>2021-12-14 11:41:09 (GMT)
commit540b52ea7b8819535ec5f456cf7c6b4792ff1675 (patch)
tree3c229cc999cb00871b2cf054c4a94336f85109fc /programs/lz4cli.c
parent4c9431e9af596af0556e5da0ae99305bafb2b10b (diff)
downloadlz4-540b52ea7b8819535ec5f456cf7c6b4792ff1675.zip
lz4-540b52ea7b8819535ec5f456cf7c6b4792ff1675.tar.gz
lz4-540b52ea7b8819535ec5f456cf7c6b4792ff1675.tar.bz2
Allow '--list' with stdin if it is a regular file
Diffstat (limited to 'programs/lz4cli.c')
-rw-r--r--programs/lz4cli.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/programs/lz4cli.c b/programs/lz4cli.c
index 57a6ab9..49fa492 100644
--- a/programs/lz4cli.c
+++ b/programs/lz4cli.c
@@ -712,11 +712,6 @@ int main(int argc, const char** argv)
}
if (mode == om_list){
- /* Exit if trying to read from stdin as this isn't supported in this mode */
- if(!strcmp(input_filename, stdinmark)){
- DISPLAYLEVEL(1, "refusing to read from standard input in --list mode\n");
- exit(1);
- }
if(!multiple_inputs){
inFileNames[ifnIdx++] = input_filename;
}
@@ -729,7 +724,7 @@ int main(int argc, const char** argv)
if (!output_filename) output_filename = "*\\dummy^!//";
/* Check if output is defined as console; trigger an error in this case */
- if (!strcmp(output_filename,stdoutmark) && IS_CONSOLE(stdout) && !forceStdout) {
+ if (!strcmp(output_filename,stdoutmark) && mode != om_list && IS_CONSOLE(stdout) && !forceStdout) {
DISPLAYLEVEL(1, "refusing to write to console without -c \n");
exit(1);
}