summaryrefslogtreecommitdiffstats
path: root/programs/lz4io.c
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2019-01-10 18:56:41 (GMT)
committerGitHub <noreply@github.com>2019-01-10 18:56:41 (GMT)
commitd4a40c6e39104f0905309090c15e7048f29fdb6b (patch)
tree2971fa892b0ac832f959df59edd068b7b9e0230e /programs/lz4io.c
parente30b1f73d42a1307ab37c6ddcdb583acf17b4457 (diff)
parent9028682e7ac1e621299b52065d47ba9f74c5c111 (diff)
downloadlz4-d4a40c6e39104f0905309090c15e7048f29fdb6b.zip
lz4-d4a40c6e39104f0905309090c15e7048f29fdb6b.tar.gz
lz4-d4a40c6e39104f0905309090c15e7048f29fdb6b.tar.bz2
Merge pull request #637 from tzakian/fix_pass-through_mode
Fix pass-through mode
Diffstat (limited to 'programs/lz4io.c')
-rw-r--r--programs/lz4io.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c
index a35928d..f7adb89 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -107,6 +107,7 @@ static clock_t g_time = 0;
/**************************************
* Local Parameters
**************************************/
+static int g_passThrough = 0;
static int g_overwrite = 1;
static int g_testMode = 0;
static int g_blockSizeId = LZ4IO_BLOCKSIZEID_DEFAULT;
@@ -157,6 +158,14 @@ int LZ4IO_setDictionaryFilename(const char* dictionaryFilename) {
return g_useDictionary;
}
+/* Default setting : passThrough = 0; return : passThrough mode (0/1) */
+int LZ4IO_setPassThrough(int yes)
+{
+ g_passThrough = (yes!=0);
+ return g_passThrough;
+}
+
+
/* Default setting : overwrite = 1; return : overwrite mode (0/1) */
int LZ4IO_setOverwrite(int yes)
{
@@ -1070,7 +1079,7 @@ static unsigned long long selectDecoder(dRess_t ress, FILE* finput, FILE* foutpu
default:
if (nbFrames == 1) { /* just started */
/* Wrong magic number at the beginning of 1st stream */
- if (!g_testMode && g_overwrite) {
+ if (!g_testMode && g_overwrite && g_passThrough) {
nbFrames = 0;
return LZ4IO_passThrough(finput, foutput, MNstore);
}