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 <tobias@stoeckmann.org>
This commit is contained in:
Tobias Stoeckmann authored and GitHub committed 2025-03-16 15:33:05 -07:00
1 parent 09a2ed4853
commit a88e09a370
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -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:
+1 -1
View File
@@ -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);