Fix issue #18.

Do not try to generate a target filename in pipe mode.
This commit is contained in:
Moinak Ghosh 2014-02-05 23:43:07 +05:30
parent 2702544d3f
commit 8a1f47917f

View file

@ -854,7 +854,7 @@ start_decompress(pc_ctx_t *pctx, const char *filename, char *to_filename)
err = 1;
goto uncomp_done;
}
if (to_filename == NULL) {
if (to_filename == NULL && !pctx->pipe_mode) {
char *pos;
/*
@ -882,6 +882,7 @@ start_decompress(pc_ctx_t *pctx, const char *filename, char *to_filename)
log_msg(LOG_WARN, 0, "Using %s for output file name.", to_filename);
}
}
if (!pctx->pipe_mode) {
origf = to_filename;
if ((to_filename = realpath(origf, NULL)) != NULL) {
free((void *)(to_filename));
@ -891,6 +892,7 @@ start_decompress(pc_ctx_t *pctx, const char *filename, char *to_filename)
}
to_filename = (char *)origf;
}
}
compressed_chunksize = chunksize + CHUNK_HDR_SZ + zlib_buf_extra(chunksize);