!40 修改解决使用-c压缩多个文件时会出现额外输出换行符

From: @zxzxzzz
Reviewed-by: @licihua
Signed-off-by: @licihua
This commit is contained in:
openeuler-ci-bot 2021-12-07 11:46:24 +00:00 committed by Gitee
commit 7a4a2e67c6
2 changed files with 40 additions and 1 deletions

View File

@ -0,0 +1,35 @@
diff -Nur zstd-1.5.0/programs/fileio.c new-zstd/programs/fileio.c
--- zstd-1.5.0/programs/fileio.c 2021-05-14 22:59:34.000000000 +0800
+++ new-zstd/programs/fileio.c 2021-12-06 16:16:11.466665414 +0800
@@ -889,26 +889,25 @@
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;
}

View File

@ -2,7 +2,7 @@
Name: zstd
Version: 1.5.0
Release: 10
Release: 11
Summary: A fast lossless compression algorithm
License: BSD and GPLv2
URL: https://github.com/facebook/zstd
@ -15,6 +15,7 @@ Patch4: backport-zstd-1.5.0-patch-4-limit-train-samples.patch
Patch5: patch-5-add-test-case-survive-a-list-of-files-which-long-file-name-length.patch
Patch6: backport-zstd-1.5.0-patch-6-fix-a-determinism-bug-with-the-DUBT.patch
Patch7: patch-7-add-test-case.patch
Patch8: patch-8-fix-extra-newline-gets-printes-out-when-compressing-multiple-files.patch
BuildRequires: gtest-devel gcc-c++ pkg-config
@ -93,6 +94,9 @@ install -D -m644 programs/zstd.1 %{buildroot}%{_mandir}/man1/pzstd.1
%{_mandir}/man1/*.1*
%changelog
* Mon Dec 06 2021 helei <helei28@huawei.com> - 1.5.0.11
* fix extra newline gets printes out when compressing multiple files
* Fri Dec 03 2021 zhangxiao <zhangxiao131@huawei.com> - 1.5.0.10
* add test case