summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--programs/lz4cli.c6
-rw-r--r--programs/lz4io.c4
-rw-r--r--tests/Makefile5
3 files changed, 11 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) {
diff --git a/tests/Makefile b/tests/Makefile
index 059fcda..952defd 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -290,6 +290,11 @@ test-lz4-multiple: lz4 datagen
$(CMP) tmp-tlm-concat1 tmp-tlm-concat2 # must be equivalent
# compress multiple files, one of which is absent (must fail)
! $(LZ4) -f -m tmp-tlm-concat1 notHere tmp-tlm-concat2 # must fail : notHere not present
+ # test lz4-compressed file
+ $(LZ4) -tm tmp-tlm-concat1.lz4
+ $(LZ4) -tm tmp-tlm-concat1.lz4 tmp-tlm-concat2.lz4
+ # compress multiple lz4 files, one of which is absent (must fail)
+ ! $(LZ4) -tm tmp-tlm-concat1.lz4 notHere.lz4 tmp-tlm-concat2.lz4
@$(RM) tmp-tlm*
test-lz4-multiple-legacy: lz4 datagen