From 7ce6f71c6f954dee08ee4217ace4fb1b5de90806 Mon Sep 17 00:00:00 2001 From: 15596858998 Date: Sun, 21 Nov 2021 12:35:58 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20playTests.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/playTests.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/playTests.sh b/tests/playTests.sh index 69653276a..4face06dd 100755 --- a/tests/playTests.sh +++ b/tests/playTests.sh @@ -713,6 +713,10 @@ test -f tmp2 test -f tmp3 test -f tmp4 +println "test : survive the list of files with too long filenames (--filelist=FILE)" +datagen -g51M > tmp_badList +zstd -f --filelist=tmp_badList && die "should have failed : file name length is too long" + println "test : survive a list of files which is text garbage (--filelist=FILE)" datagen > tmp_badList zstd -f --filelist=tmp_badList && die "should have failed : list is text garbage" From e315a047c7c6b804cfd5f27a3f1e2220b523e773 Mon Sep 17 00:00:00 2001 From: 15596858998 Date: Tue, 23 Nov 2021 22:08:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20fileio.c?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Solve the logic problem of wrong output of newline characters. --- programs/fileio.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/programs/fileio.c b/programs/fileio.c index 8e5301dee..de0c318e4 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -889,26 +889,25 @@ static int FIO_removeMultiFilesWarning(FIO_ctx_t* const fCtx, const FIO_prefs_t* if (fCtx->nbFilesTotal > 1 && !prefs->overwrite) { if (g_display_prefs.displayLevel <= displayLevelCutoff) { if (prefs->removeSrcFile) { - DISPLAYLEVEL(1, "zstd: Aborting... not deleting files and processing into dst: %s", outFileName); + DISPLAYLEVEL(1, "zstd: Aborting... not deleting files and processing into dst: %s\n", outFileName); error = 1; } } else { if (!strcmp(outFileName, stdoutmark)) { - DISPLAYLEVEL(2, "zstd: WARNING: all input files will be processed and concatenated into stdout. "); + DISPLAYLEVEL(2, "zstd: WARNING: all input files will be processed and concatenated into stdout. \n"); } else { - DISPLAYLEVEL(2, "zstd: WARNING: all input files will be processed and concatenated into a single output file: %s ", outFileName); + DISPLAYLEVEL(2, "zstd: WARNING: all input files will be processed and concatenated into a single output file: %s \n", outFileName); } - DISPLAYLEVEL(2, "\nThe concatenated output CANNOT regenerate the original directory tree. ") + DISPLAYLEVEL(2, "The concatenated output CANNOT regenerate the original directory tree. \n") if (prefs->removeSrcFile) { if (fCtx->hasStdoutOutput) { - DISPLAYLEVEL(1, "\nAborting. Use -f if you really want to delete the files and output to stdout"); + DISPLAYLEVEL(1, "Aborting. Use -f if you really want to delete the files and output to stdout\n"); error = 1; } else { error = g_display_prefs.displayLevel > displayLevelCutoff && UTIL_requireUserConfirmation("This is a destructive operation. Proceed? (y/n): ", "Aborting...", "yY", fCtx->hasStdinInput); } } } - DISPLAY("\n"); } return error; }