]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
cli : fix : --rm is silent when input is stdin (decompression)
authorPrzemyslaw Skibinski <inikep@gmail.com>
Tue, 28 Feb 2017 08:42:37 +0000 (09:42 +0100)
committerPrzemyslaw Skibinski <inikep@gmail.com>
Tue, 28 Feb 2017 08:42:37 +0000 (09:42 +0100)
programs/fileio.c

index 7f076aa157f2c35fa7645816cda5b3ae742ce9f2..41daa125e603eeefe6331ed2f3cb002b267ba056 100644 (file)
@@ -954,7 +954,7 @@ static int FIO_decompressSrcFile(dRess_t ress, const char* dstFileName, const ch
 
     /* Close file */
     if (fclose(srcFile)) EXM_THROW(33, "zstd: %s close error", srcFileName);  /* error should never happen */
-    if (g_removeSrcFile) { if (remove(srcFileName)) EXM_THROW(34, "zstd: %s: %s", srcFileName, strerror(errno)); };
+    if (g_removeSrcFile /* --rm */ && strcmp(srcFileName, stdinmark)) { if (remove(srcFileName)) EXM_THROW(34, "zstd: %s: %s", srcFileName, strerror(errno)); };
     return 0;
 }