From cc2412401400fbacd7530b8dcc4af0b0d7c734ce Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Mon, 13 Apr 2015 20:43:54 +0100 Subject: minor compatibility fixes --- README.md | 7 +++---- programs/lz4.1 | 6 +++--- programs/lz4cli.c | 14 ++++++++------ programs/lz4io.c | 21 ++++++++++++--------- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 0945f85..5d506d4 100644 --- a/README.md +++ b/README.md @@ -22,12 +22,11 @@ It trades CPU time for compression ratio. > **Branch Policy:** > - The "master" branch is considered stable, at all times. -> - The "dev" branch is the one where all contributions must be merged +> - The "dev" branch is the one where all contributions must be merged before being promoted to master. -> + If you plan to propose a patch, please commit into the "dev" branch. +> + If you plan to propose a patch, please commit into the "dev" branch, + or its own feature branch. Direct commit to "master" are not permitted. -> - Feature branches can also exist, - for dedicated tests of larger modifications before merge into "dev" branch. Benchmarks ------------------------- diff --git a/programs/lz4.1 b/programs/lz4.1 index 1225832..eea248f 100644 --- a/programs/lz4.1 +++ b/programs/lz4.1 @@ -158,13 +158,13 @@ for files that have not been compressed with force write to standard output, even if it is the console .TP -.BR \-m +.BR \-m ", " \--multiple Multiple file names. By default, the second filename is used as the output filename for the compressed file. With .B -m -, you can specify any number of input filenames, each of them will be compressed -with the resulting compressed file named +, you can specify any number of input filenames. Each of them will be compressed +independently, and the resulting name of the compressed file will be .B filename.lz4 . diff --git a/programs/lz4cli.c b/programs/lz4cli.c index ffc54c0..8d7d5ca 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -266,7 +266,7 @@ int main(int argc, char** argv) forceCompress=0, main_pause=0, multiple_inputs=0, - multiple_rv=0; + operationResult=0; const char* input_filename=0; const char* output_filename=0; char* dynNameSpace=0; @@ -295,12 +295,13 @@ int main(int argc, char** argv) /* long commands (--long-word) */ if (!strcmp(argument, "--compress")) { forceCompress = 1; continue; } if ((!strcmp(argument, "--decompress")) - || (!strcmp(argument, "--uncompress"))) { decode = 1; continue; } + || (!strcmp(argument, "--uncompress"))) { decode = 1; continue; } + if (!strcmp(argument, "--multiple")) { multiple_inputs = 1; if (inFileNames==NULL) inFileNames = (const char**)malloc(argc * sizeof(char*)); continue; } if (!strcmp(argument, "--test")) { decode = 1; LZ4IO_setOverwrite(1); output_filename=nulmark; continue; } if (!strcmp(argument, "--force")) { LZ4IO_setOverwrite(1); continue; } if (!strcmp(argument, "--no-force")) { LZ4IO_setOverwrite(0); continue; } if ((!strcmp(argument, "--stdout")) - || (!strcmp(argument, "--to-stdout"))) { forceStdout=1; output_filename=stdoutmark; displayLevel=1; continue; } + || (!strcmp(argument, "--to-stdout"))) { forceStdout=1; output_filename=stdoutmark; displayLevel=1; continue; } if (!strcmp(argument, "--frame-crc")) { LZ4IO_setStreamChecksumMode(1); continue; } if (!strcmp(argument, "--no-frame-crc")) { LZ4IO_setStreamChecksumMode(0); continue; } if (!strcmp(argument, "--content-size")) { LZ4IO_setContentSize(1); continue; } @@ -312,6 +313,7 @@ int main(int argc, char** argv) if (!strcmp(argument, "--version")) { DISPLAY(WELCOME_MESSAGE); return 0; } if (!strcmp(argument, "--keep")) { continue; } /* keep source file (default anyway; just for xz/lzma compatibility) */ + /* Short commands (note : aggregated short commands are allowed) */ if (argument[0]=='-') { @@ -528,7 +530,7 @@ int main(int argc, char** argv) if (decode) { if (multiple_inputs) - multiple_rv = LZ4IO_decompressMultipleFilenames(inFileNames, ifnIdx, LZ4_EXTENSION); + operationResult = LZ4IO_decompressMultipleFilenames(inFileNames, ifnIdx, LZ4_EXTENSION); else DEFAULT_DECOMPRESSOR(input_filename, output_filename); } @@ -543,7 +545,7 @@ int main(int argc, char** argv) else { if (multiple_inputs) - multiple_rv = LZ4IO_compressMultipleFilenames(inFileNames, ifnIdx, LZ4_EXTENSION, cLevel); + operationResult = LZ4IO_compressMultipleFilenames(inFileNames, ifnIdx, LZ4_EXTENSION, cLevel); else DEFAULT_COMPRESSOR(input_filename, output_filename, cLevel); } @@ -552,6 +554,6 @@ int main(int argc, char** argv) if (main_pause) waitEnter(); free(dynNameSpace); free((void*)inFileNames); - if (multiple_rv != 0) return multiple_rv; + if (operationResult != 0) return operationResult; return 0; } diff --git a/programs/lz4io.c b/programs/lz4io.c index c510f1d..7a3c10d 100644 --- a/programs/lz4io.c +++ b/programs/lz4io.c @@ -509,21 +509,21 @@ int LZ4IO_compressMultipleFilenames(const char** inFileNamesTable, int ifntSize, { int i; int missing_files = 0; - FILE *ifp; char* outFileName = (char*)malloc(FNSPACE); size_t ofnSize = FNSPACE; const size_t suffixSize = strlen(suffix); for (i=0; i 0) return 1; if (missing_files > 0) return 1; return 0; -- cgit v0.12