Added GNU separator --, to specifies that all following arguments are necessary file names (and not commands). Suggested by @chipturner (#230)
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
v0.7.3
|
v0.7.3
|
||||||
|
added : `--` separator, stating that all following arguments are file names. Suggested by Chip Turner.
|
||||||
added : OpenBSD target, by Juan Francisco Cantero Hurtado
|
added : OpenBSD target, by Juan Francisco Cantero Hurtado
|
||||||
|
|
||||||
v0.7.2
|
v0.7.2
|
||||||
|
|||||||
@@ -735,7 +735,7 @@ static seq_t ZSTD_decodeSequence(seqState_t* seqState)
|
|||||||
if (MEM_32bits() && (mlBits+llBits>24)) BIT_reloadDStream(&(seqState->DStream));
|
if (MEM_32bits() && (mlBits+llBits>24)) BIT_reloadDStream(&(seqState->DStream));
|
||||||
|
|
||||||
seq.litLength = LL_base[llCode] + ((llCode>15) ? BIT_readBits(&(seqState->DStream), llBits) : 0); /* <= 16 bits */
|
seq.litLength = LL_base[llCode] + ((llCode>15) ? BIT_readBits(&(seqState->DStream), llBits) : 0); /* <= 16 bits */
|
||||||
if (MEM_32bits() |
|
if (MEM_32bits() ||
|
||||||
(totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BIT_reloadDStream(&(seqState->DStream));
|
(totalBits > 64 - 7 - (LLFSELog+MLFSELog+OffFSELog)) ) BIT_reloadDStream(&(seqState->DStream));
|
||||||
|
|
||||||
/* ANS state update */
|
/* ANS state update */
|
||||||
|
|||||||
+27
-21
@@ -34,7 +34,7 @@
|
|||||||
#include "util.h" /* Compiler options, UTIL_HAS_CREATEFILELIST */
|
#include "util.h" /* Compiler options, UTIL_HAS_CREATEFILELIST */
|
||||||
#include <string.h> /* strcmp, strlen */
|
#include <string.h> /* strcmp, strlen */
|
||||||
#include <ctype.h> /* toupper */
|
#include <ctype.h> /* toupper */
|
||||||
#include <errno.h>
|
#include <errno.h> /* errno */
|
||||||
#include "fileio.h"
|
#include "fileio.h"
|
||||||
#ifndef ZSTD_NOBENCH
|
#ifndef ZSTD_NOBENCH
|
||||||
# include "bench.h" /* BMK_benchFiles, BMK_SetNbIterations */
|
# include "bench.h" /* BMK_benchFiles, BMK_SetNbIterations */
|
||||||
@@ -205,7 +205,8 @@ int main(int argCount, const char** argv)
|
|||||||
dictBuild=0,
|
dictBuild=0,
|
||||||
nextArgumentIsOutFileName=0,
|
nextArgumentIsOutFileName=0,
|
||||||
nextArgumentIsMaxDict=0,
|
nextArgumentIsMaxDict=0,
|
||||||
nextArgumentIsDictID=0;
|
nextArgumentIsDictID=0,
|
||||||
|
nextArgumentIsFile=0;
|
||||||
unsigned cLevel = 1;
|
unsigned cLevel = 1;
|
||||||
unsigned cLevelLast = 1;
|
unsigned cLevelLast = 1;
|
||||||
unsigned recursive = 0;
|
unsigned recursive = 0;
|
||||||
@@ -247,7 +248,10 @@ int main(int argCount, const char** argv)
|
|||||||
const char* argument = argv[argNb];
|
const char* argument = argv[argNb];
|
||||||
if(!argument) continue; /* Protection if argument empty */
|
if(!argument) continue; /* Protection if argument empty */
|
||||||
|
|
||||||
|
if (nextArgumentIsFile==0) {
|
||||||
|
|
||||||
/* long commands (--long-word) */
|
/* long commands (--long-word) */
|
||||||
|
if (!strcmp(argument, "--")) { nextArgumentIsFile=1; continue; }
|
||||||
if (!strcmp(argument, "--decompress")) { decode=1; continue; }
|
if (!strcmp(argument, "--decompress")) { decode=1; continue; }
|
||||||
if (!strcmp(argument, "--force")) { FIO_overwriteMode(); continue; }
|
if (!strcmp(argument, "--force")) { FIO_overwriteMode(); continue; }
|
||||||
if (!strcmp(argument, "--version")) { displayOut=stdout; DISPLAY(WELCOME_MESSAGE); CLEAN_RETURN(0); }
|
if (!strcmp(argument, "--version")) { displayOut=stdout; DISPLAY(WELCOME_MESSAGE); CLEAN_RETURN(0); }
|
||||||
@@ -282,7 +286,7 @@ int main(int argCount, const char** argv)
|
|||||||
argument++;
|
argument++;
|
||||||
|
|
||||||
while (argument[0]!=0) {
|
while (argument[0]!=0) {
|
||||||
#ifndef ZSTD_NOCOMPRESS
|
#ifndef ZSTD_NOCOMPRESS
|
||||||
/* compression Level */
|
/* compression Level */
|
||||||
if ((*argument>='0') && (*argument<='9')) {
|
if ((*argument>='0') && (*argument<='9')) {
|
||||||
cLevel = readU32FromChar(&argument);
|
cLevel = readU32FromChar(&argument);
|
||||||
@@ -291,7 +295,7 @@ int main(int argCount, const char** argv)
|
|||||||
CLEAN_RETURN(badusage(programName));
|
CLEAN_RETURN(badusage(programName));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch(argument[0])
|
switch(argument[0])
|
||||||
{
|
{
|
||||||
@@ -333,7 +337,7 @@ int main(int argCount, const char** argv)
|
|||||||
/* recursive */
|
/* recursive */
|
||||||
case 'r': recursive=1; argument++; break;
|
case 'r': recursive=1; argument++; break;
|
||||||
|
|
||||||
#ifndef ZSTD_NOBENCH
|
#ifndef ZSTD_NOBENCH
|
||||||
/* Benchmark */
|
/* Benchmark */
|
||||||
case 'b': bench=1; argument++; break;
|
case 'b': bench=1; argument++; break;
|
||||||
|
|
||||||
@@ -364,7 +368,7 @@ int main(int argCount, const char** argv)
|
|||||||
BMK_SetBlockSize(bSize);
|
BMK_SetBlockSize(bSize);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
#endif /* ZSTD_NOBENCH */
|
#endif /* ZSTD_NOBENCH */
|
||||||
|
|
||||||
/* Dictionary Selection level */
|
/* Dictionary Selection level */
|
||||||
case 's':
|
case 's':
|
||||||
@@ -374,11 +378,11 @@ int main(int argCount, const char** argv)
|
|||||||
|
|
||||||
/* Pause at the end (-p) or set an additional param (-p#) (hidden option) */
|
/* Pause at the end (-p) or set an additional param (-p#) (hidden option) */
|
||||||
case 'p': argument++;
|
case 'p': argument++;
|
||||||
#ifndef ZSTD_NOBENCH
|
#ifndef ZSTD_NOBENCH
|
||||||
if ((*argument>='0') && (*argument<='9')) {
|
if ((*argument>='0') && (*argument<='9')) {
|
||||||
BMK_setAdditionalParam(readU32FromChar(&argument));
|
BMK_setAdditionalParam(readU32FromChar(&argument));
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
main_pause=1;
|
main_pause=1;
|
||||||
break;
|
break;
|
||||||
/* unknown command */
|
/* unknown command */
|
||||||
@@ -388,19 +392,6 @@ int main(int argCount, const char** argv)
|
|||||||
continue;
|
continue;
|
||||||
} /* if (argument[0]=='-') */
|
} /* if (argument[0]=='-') */
|
||||||
|
|
||||||
if (nextEntryIsDictionary) {
|
|
||||||
nextEntryIsDictionary = 0;
|
|
||||||
dictFileName = argument;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nextArgumentIsOutFileName) {
|
|
||||||
nextArgumentIsOutFileName = 0;
|
|
||||||
outFileName = argument;
|
|
||||||
if (!strcmp(outFileName, "-")) outFileName = stdoutmark;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nextArgumentIsMaxDict) {
|
if (nextArgumentIsMaxDict) {
|
||||||
nextArgumentIsMaxDict = 0;
|
nextArgumentIsMaxDict = 0;
|
||||||
maxDictSize = readU32FromChar(&argument);
|
maxDictSize = readU32FromChar(&argument);
|
||||||
@@ -415,6 +406,21 @@ int main(int argCount, const char** argv)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} /* if (nextArgumentIsAFile==0) */
|
||||||
|
|
||||||
|
if (nextEntryIsDictionary) {
|
||||||
|
nextEntryIsDictionary = 0;
|
||||||
|
dictFileName = argument;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nextArgumentIsOutFileName) {
|
||||||
|
nextArgumentIsOutFileName = 0;
|
||||||
|
outFileName = argument;
|
||||||
|
if (!strcmp(outFileName, "-")) outFileName = stdoutmark;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* add filename to list */
|
/* add filename to list */
|
||||||
filenameTable[filenameIdx++] = argument;
|
filenameTable[filenameIdx++] = argument;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user