summaryrefslogtreecommitdiffstats
path: root/programs/lz4io.c
diff options
context:
space:
mode:
Diffstat (limited to 'programs/lz4io.c')
-rw-r--r--programs/lz4io.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/programs/lz4io.c b/programs/lz4io.c
index f2d7b51..3a85830 100644
--- a/programs/lz4io.c
+++ b/programs/lz4io.c
@@ -136,6 +136,7 @@ static clock_t g_time = 0;
* Local Parameters
**************************************/
static int g_overwrite = 1;
+static int g_passThrough = 1;
static int g_blockSizeId = LZ4IO_BLOCKSIZEID_DEFAULT;
static int g_blockChecksum = 0;
static int g_streamChecksum = 1;
@@ -184,6 +185,13 @@ int LZ4IO_setOverwrite(int yes)
return g_overwrite;
}
+/* Default setting : passThrough = 1; return : passThrough mode (0/1) */
+int LZ4IO_setPassThrough(int yes)
+{
+ g_passThrough = (yes!=0);
+ return g_passThrough;
+}
+
/* blockSizeID : valid values : 4-5-6-7 */
int LZ4IO_setBlockSizeID(int bsid)
{
@@ -283,7 +291,7 @@ static int LZ4IO_getFiles(const char* input_filename, const char* output_filenam
} else {
/* Check if destination file already exists */
*pfoutput=0;
- if (output_filename != nulmark) *pfoutput = fopen( output_filename, "rb" );
+ if (strcmp(output_filename, nulmark)) *pfoutput = fopen( output_filename, "rb" );
if (*pfoutput!=0) {
fclose(*pfoutput);
if (!g_overwrite) {
@@ -908,7 +916,7 @@ static unsigned long long selectDecoder(dRess_t ress, FILE* finput, FILE* foutpu
EXTENDED_FORMAT; /* macro extension for custom formats */
default:
if (nbCalls == 1) { /* just started */
- if (g_overwrite)
+ if (g_passThrough && g_overwrite)
return LZ4IO_passThrough(finput, foutput, MNstore);
EXM_THROW(44,"Unrecognized header : file cannot be decoded"); /* Wrong magic number at the beginning of 1st stream */
}