From: Tobias Stoeckmann Date: Sun, 16 Mar 2025 22:33:05 +0000 (+0100) Subject: Remove extra newline from error messages (#2541) X-Git-Tag: v3.8.0~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a88e09a37069dd6a07d65f6dfee08a8563d79d8c;p=thirdparty%2Flibarchive.git Remove extra newline from error messages (#2541) The lafe_errc function adds a newline by itself already, so do not insert one into the message. You can reproduce with the following commands: ``` touch archive.tar bsdtar -xf archive.tar -C /non-existing ``` ``` bsdtar --exclude "" ``` Signed-off-by: Tobias Stoeckmann --- diff --git a/tar/bsdtar.c b/tar/bsdtar.c index daa24ffe5..bce8344fc 100644 --- a/tar/bsdtar.c +++ b/tar/bsdtar.c @@ -334,7 +334,7 @@ main(int argc, char **argv) if (archive_match_exclude_pattern( bsdtar->matching, bsdtar->argument) != ARCHIVE_OK) lafe_errc(1, 0, - "Couldn't exclude %s\n", bsdtar->argument); + "Couldn't exclude %s", bsdtar->argument); break; case OPTION_EXCLUDE_VCS: /* GNU tar */ for(t=0; vcs_files[t]; t++) { @@ -342,7 +342,7 @@ main(int argc, char **argv) bsdtar->matching, vcs_files[t]) != ARCHIVE_OK) lafe_errc(1, 0, "Couldn't " - "exclude %s\n", vcs_files[t]); + "exclude %s", vcs_files[t]); } break; case OPTION_FFLAGS: diff --git a/tar/util.c b/tar/util.c index f3cbdf0bb..e46700821 100644 --- a/tar/util.c +++ b/tar/util.c @@ -329,7 +329,7 @@ do_chdir(struct bsdtar *bsdtar) return; if (chdir(bsdtar->pending_chdir) != 0) { - lafe_errc(1, 0, "could not chdir to '%s'\n", + lafe_errc(1, 0, "could not chdir to '%s'", bsdtar->pending_chdir); } free(bsdtar->pending_chdir);