summaryrefslogtreecommitdiffstats
path: root/programs
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2022-07-01 09:21:44 (GMT)
committerYann Collet <cyan@fb.com>2022-07-01 09:21:44 (GMT)
commit149644df49ba112daeff85f0bed229253516cc8c (patch)
treea0391ed1009029bffed10d3b22a501bd21328ded /programs
parentfcbf585598da6af5878693a58fa460b772e8cc61 (diff)
downloadlz4-149644df49ba112daeff85f0bed229253516cc8c.zip
lz4-149644df49ba112daeff85f0bed229253516cc8c.tar.gz
lz4-149644df49ba112daeff85f0bed229253516cc8c.tar.bz2
fixed -tm
which was broken up to now.
Diffstat (limited to 'programs')
-rw-r--r--programs/lz4cli.c6
-rw-r--r--programs/lz4io.c4
2 files changed, 6 insertions, 4 deletions
diff --git a/programs/lz4cli.c b/programs/lz4cli.c
index 54a2e03..45f88f4 100644
--- a/programs/lz4cli.c
+++ b/programs/lz4cli.c
@@ -739,8 +739,10 @@ int main(int argc, const char** argv)
if (ifnIdx == 0) multiple_inputs = 0;
if (mode == om_decompress) {
if (multiple_inputs) {
- const char* const dec_extension = !strcmp(output_filename,stdoutmark) ? stdoutmark : LZ4_EXTENSION;
- assert(ifnIdx <= INT_MAX);
+ const char* dec_extension = LZ4_EXTENSION;
+ if (!strcmp(output_filename, stdoutmark)) dec_extension = stdoutmark;
+ if (!strcmp(output_filename, nulmark)) dec_extension = nulmark;
+ assert(ifnIdx < INT_MAX);
operationResult = LZ4IO_decompressMultipleFilenames(inFileNames, (int)ifnIdx, dec_extension, prefs);
} else {
operationResult = DEFAULT_DECOMPRESSOR(input_filename, output_filename, prefs);
diff --git a/programs/lz4io.c b/programs/lz4io.c
index 78581d8..36736c2 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -1343,8 +1343,8 @@ int LZ4IO_decompressMultipleFilenames(
for (i=0; i<ifntSize; i++) {
size_t const ifnSize = strlen(inFileNamesTable[i]);
const char* const suffixPtr = inFileNamesTable[i] + ifnSize - suffixSize;
- if (LZ4IO_isStdout(suffix)) {
- missingFiles += LZ4IO_decompressSrcFile(ress, inFileNamesTable[i], stdoutmark, prefs);
+ if (LZ4IO_isStdout(suffix) || LZ4IO_isDevNull(suffix)) {
+ missingFiles += LZ4IO_decompressSrcFile(ress, inFileNamesTable[i], suffix, prefs);
continue;
}
if (ofnSize <= ifnSize-suffixSize+1) {