diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2016-11-04 20:49:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-04 20:49:19 (GMT) |
commit | 10c5d5eee3b1afad66b3c5c6ce7640484acbad77 (patch) | |
tree | 2b254e96b1290055e43ac77892cc9d76c7eb1ce9 | |
parent | f878c08b76a58e083c47470284139f3006c8e746 (diff) | |
parent | 86a24c80f4689fd88c48849c53eb0f0f4de4e5d7 (diff) | |
download | lz4-10c5d5eee3b1afad66b3c5c6ce7640484acbad77.zip lz4-10c5d5eee3b1afad66b3c5c6ce7640484acbad77.tar.gz lz4-10c5d5eee3b1afad66b3c5c6ce7640484acbad77.tar.bz2 |
Merge pull request #253 from terrelln/exit-code
Return error if input file does not exist.
-rw-r--r-- | lib/lz4.c | 4 | ||||
-rw-r--r-- | programs/lz4.1 | 2 | ||||
-rw-r--r-- | programs/lz4cli.c | 4 | ||||
-rw-r--r-- | tests/Makefile | 5 |
4 files changed, 10 insertions, 5 deletions
@@ -426,9 +426,9 @@ static U32 LZ4_hashSequence64(U64 sequence, tableType_t const tableType) static const U64 prime8bytes = 11400714785074694791ULL; const U32 hashLog = (tableType == byU16) ? LZ4_HASHLOG+1 : LZ4_HASHLOG; if (LZ4_isLittleEndian()) - return ((sequence << 24) * prime5bytes) >> (64 - hashLog); + return (U32)(((sequence << 24) * prime5bytes) >> (64 - hashLog)); else - return ((sequence >> 24) * prime8bytes) >> (64 - hashLog); + return (U32)(((sequence >> 24) * prime8bytes) >> (64 - hashLog)); } static U32 LZ4_hashSequenceT(size_t sequence, tableType_t const tableType) diff --git a/programs/lz4.1 b/programs/lz4.1 index 51a37f1..059b820 100644 --- a/programs/lz4.1 +++ b/programs/lz4.1 @@ -121,7 +121,7 @@ Decompress. .B --decompress is also the default operation when the input filename has an .B .lz4 -extensionq +extension. .TP .BR \-t ", " \-\-test Test the integrity of compressed diff --git a/programs/lz4cli.c b/programs/lz4cli.c index a6f4b4e..f77be3d 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -550,7 +550,7 @@ int main(int argc, const char** argv) if (multiple_inputs) operationResult = LZ4IO_decompressMultipleFilenames(inFileNames, ifnIdx, LZ4_EXTENSION); else - DEFAULT_DECOMPRESSOR(input_filename, output_filename); + operationResult = DEFAULT_DECOMPRESSOR(input_filename, output_filename); } else { /* compression is default action */ if (legacy_format) { @@ -560,7 +560,7 @@ int main(int argc, const char** argv) if (multiple_inputs) operationResult = LZ4IO_compressMultipleFilenames(inFileNames, ifnIdx, LZ4_EXTENSION, cLevel); else - DEFAULT_COMPRESSOR(input_filename, output_filename, cLevel); + operationResult = DEFAULT_COMPRESSOR(input_filename, output_filename, cLevel); } } diff --git a/tests/Makefile b/tests/Makefile index 0c44b21..bfbafd8 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -221,6 +221,11 @@ test-lz4: lz4 datagen test-lz4-basic test-lz4-multiple test-lz4-sparse test-lz4- ./datagen | $(PRGDIR)/lz4 -tf && false || true ./datagen | $(PRGDIR)/lz4 -d > $(VOID) && false || true ./datagen | $(PRGDIR)/lz4 -df > $(VOID) + @echo "\n ---- test cli ----" + $(PRGDIR)/lz4 file-does-not-exist && false || true + $(PRGDIR)/lz4 -f file-does-not-exist && false || true + $(PRGDIR)/lz4 -fm file1-dne file2-dne && false || true + $(PRGDIR)/lz4 -fm file1-dne file2-dne && false || true test-lz4c: lz4c datagen @echo "\n ---- test lz4c version ----" |