]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Fix error message printing (#2368)
authorTim Kientzle <kientzle@acm.org>
Fri, 11 Oct 2024 06:11:43 +0000 (23:11 -0700)
committerGitHub <noreply@github.com>
Fri, 11 Oct 2024 06:11:43 +0000 (08:11 +0200)
We always print the error message with or without -v, but for some
reason, we were omitting the path being processed. Simplify so that we
always print the full error including context.

tar/write.c

index 43cd7023339795064a805474e3b653560fc9e8ea..22f21ff6954a8f8c9fec229f66e0899f87c58e73 100644 (file)
@@ -984,12 +984,11 @@ write_entry(struct bsdtar *bsdtar, struct archive *a,
                        safe_fprintf(stderr, "a ");
                        list_item_verbose(bsdtar, stderr, entry);
                        lafe_warnc(0, ": %s", archive_error_string(a));
-               } else if (bsdtar->verbose > 0) {
+               } else {
                        lafe_warnc(0, "%s: %s",
                            archive_entry_pathname(entry),
                            archive_error_string(a));
-               } else
-                       fprintf(stderr, ": %s", archive_error_string(a));
+               }
        }
 
        if (e == ARCHIVE_FATAL)