]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Add callsites to zstdcli.c and tests to playTests.sh 2329/head
authorsenhuang42 <senhuang96@fb.com>
Wed, 7 Oct 2020 17:47:38 +0000 (13:47 -0400)
committersenhuang42 <senhuang96@fb.com>
Wed, 7 Oct 2020 17:47:38 +0000 (13:47 -0400)
programs/zstdcli.c
tests/playTests.sh

index b1893ca47e9a22fafee69668da62c34c267c38d7..9b6f915334625579f30cc176b1fb09400ba8469b 100644 (file)
@@ -697,6 +697,7 @@ int main(int const argCount, const char* argv[])
     int argNb,
         followLinks = 0,
         forceStdout = 0,
+        hasStdout = 0,
         ldmFlag = 0,
         main_pause = 0,
         nbWorkers = 0,
@@ -1282,9 +1283,12 @@ int main(int const argCount, const char* argv[])
     }
     
     /* No status message in pipe mode (stdin - stdout) */      
-    if (!strcmp(filenames->fileNames[0], stdinmark) && outFileName && !strcmp(outFileName,stdoutmark) && (g_displayLevel==2)) g_displayLevel=1;
+    hasStdout = outFileName && !strcmp(outFileName,stdoutmark);
+
+    if (hasStdout && (g_displayLevel==2)) g_displayLevel=1;
 
     /* IO Stream/File */
+    FIO_setHasStdoutOutput(fCtx, hasStdout);
     FIO_setNbFilesTotal(fCtx, (int)filenames->tableSize); 
     FIO_determineHasStdinInput(fCtx, filenames);
     FIO_setNotificationLevel(g_displayLevel);
index 7f75d8506bd25b74218a2fb511d16d70b011a47a..fd602e7aedf134cc26dfbb401967329898dc4e5b 100755 (executable)
@@ -396,9 +396,8 @@ cp tmp_rm3.zst tmp_rm4.zst
 echo 'Y' | zstd -d tmp_rm3.zst tmp_rm4.zst -o tmp_rm_out --rm
 test ! -f tmp_rm3.zst
 test ! -f tmp_rm4.zst
-echo 'yes' | zstd tmp_rm_out tmp_rm3 -c --rm > $INTOVOID
-test ! -f tmp_rm_out
-test ! -f tmp_rm3
+echo 'yes' | zstd tmp_rm_out tmp_rm3 -c --rm && die "compressing multiple files to stdout with --rm should fail unless -f is specified"
+echo 'yes' | zstd tmp_rm_out tmp_rm3 -c --rm -v && die "compressing multiple files to stdout with --rm should fail unless -f is specified"
 println gooder > tmpexists1
 zstd tmpexists1 tmpexists -c --rm -f > $INTOVOID