diff options
author | gabrielstedman <gabriwinter@gmail.com> | 2019-04-22 08:58:26 (GMT) |
---|---|---|
committer | gabrielstedman <gabriwinter@gmail.com> | 2019-04-22 09:02:46 (GMT) |
commit | 0acebbe53dd1b15071f2c48a7b060299b5d03622 (patch) | |
tree | b5e09fc4253f29d6468358a4350c2b69fe4ac46a /programs/lz4cli.c | |
parent | 9d0960c354c9018957856334b1901bd693efe995 (diff) | |
download | lz4-0acebbe53dd1b15071f2c48a7b060299b5d03622.zip lz4-0acebbe53dd1b15071f2c48a7b060299b5d03622.tar.gz lz4-0acebbe53dd1b15071f2c48a7b060299b5d03622.tar.bz2 |
FR #598 - Move LZ4F_compFileInfo_t def to lz4frame.h discard output_file
assert if in om_list mode
Diffstat (limited to 'programs/lz4cli.c')
-rw-r--r-- | programs/lz4cli.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/programs/lz4cli.c b/programs/lz4cli.c index 3315773..443e4b4 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -693,7 +693,7 @@ int main(int argc, const char** argv) break; } - if (multiple_inputs==0) assert(output_filename); + if (multiple_inputs==0 && mode != om_list) assert(output_filename); /* when multiple_inputs==1, output_filename may simply be useless, * however, output_filename must be !NULL for next strcmp() tests */ if (!output_filename) output_filename = "*\\dummy^!//"; @@ -721,7 +721,14 @@ int main(int argc, const char** argv) operationResult = LZ4IO_decompressMultipleFilenames(prefs, inFileNames, (int)ifnIdx, !strcmp(output_filename,stdoutmark) ? stdoutmark : LZ4_EXTENSION); } else { operationResult = DEFAULT_DECOMPRESSOR(prefs, input_filename, output_filename); - + } + } else if (mode == om_list){ + if(!multiple_inputs){ + inFileNames[ifnIdx++] = input_filename; + } + operationResult = LZ4IO_displayCompressedFilesInfo(inFileNames, ifnIdx); + inFileNames=NULL; + } else { /* compression is default action */ if (legacy_format) { DISPLAYLEVEL(3, "! Generating LZ4 Legacy format (deprecated) ! \n"); LZ4IO_compressFilename_Legacy(prefs, input_filename, output_filename, cLevel); @@ -745,4 +752,4 @@ _cleanup: LZ4IO_freePreferences(prefs); free((void*)inFileNames); return operationResult; -} +}
\ No newline at end of file |