lafe_errc(1, archive_errno(a),
"%s", archive_error_string(a));
}
- if (archive_match_path_excluded(cpio->matching, entry))
+ r = archive_match_path_excluded(cpio->matching, entry);
+ if (r < 0)
+ lafe_errc(1, 0, "%s", archive_error_string(cpio->matching));
+ if (r)
continue;
if (cpio->option_rename)
cpio_rename(entry);
lafe_errc(1, archive_errno(a),
"%s", archive_error_string(a));
}
- if (archive_match_path_excluded(cpio->matching, entry))
+ r = archive_match_path_excluded(cpio->matching, entry);
+ if (r < 0)
+ lafe_errc(1, 0, "%s", archive_error_string(cpio->matching));
+ if (r)
continue;
if (cpio->verbose)
list_item_verbose(cpio, entry);
for (;;) {
/* Support --fast-read option */
const char *p;
- if ((bsdtar->flags & OPTFLAG_FAST_READ) &&
- archive_match_path_unmatched_inclusions(bsdtar->matching) == 0)
- break;
+
+ if (bsdtar->flags & OPTFLAG_FAST_READ) {
+ r = archive_match_path_unmatched_inclusions(bsdtar->matching);
+ if (r < 0)
+ lafe_errc(1, 0, "%s", archive_error_string(a));
+ if (!r)
+ break;
+ }
r = archive_read_next_header(a, &entry);
progress_data.entry = entry;
* rewrite, there would be no way to exclude foo1/bar
* while allowing foo2/bar.)
*/
- if (archive_match_excluded(bsdtar->matching, entry))
+ r = archive_match_excluded(bsdtar->matching, entry);
+ if (r == ARCHIVE_FATAL)
+ lafe_errc(1, 0, "%s",
+ archive_error_string(bsdtar->matching));
+ if (r)
continue; /* Excluded by a pattern test. */
if (mode == 't') {
matching, &p)) == ARCHIVE_OK)
lafe_warnc(0, "%s: %s", p, msg);
if (r == ARCHIVE_FATAL)
- lafe_errc(1, errno, "Out of memory");
+ lafe_errc(1, 0, "%s", archive_error_string(matching));
return (archive_match_path_unmatched_inclusions(matching));
}
int e;
while (ARCHIVE_OK == (e = archive_read_next_header(ina, &in_entry))) {
- if (archive_match_excluded(bsdtar->matching, in_entry))
+ e = archive_match_excluded(bsdtar->matching, in_entry);
+ if (e < 0) {
+ if (!bsdtar->verbose)
+ lafe_errc(1, 0, "%s",
+ archive_error_string(bsdtar->matching));
+ else {
+ fprintf(stderr, ": %s",
+ archive_error_string(bsdtar->matching));
+ exit(1);
+ }
+ }
+ if (e)
continue;
if(edit_pathname(bsdtar, in_entry))
continue;