From 39df0279539b519ad83ae12a5dedd50e6ecdc5d1 Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Fri, 30 Nov 2012 10:21:28 +0900 Subject: [PATCH] Do not return "Unknown module name" error when a format name matches a specfied module name and the option name is wrong and filter names do not matche the specfied module name. --- libarchive/archive_options.c | 2 ++ libarchive/archive_write_set_options.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libarchive/archive_options.c b/libarchive/archive_options.c index 0da814926..8af623931 100644 --- a/libarchive/archive_options.c +++ b/libarchive/archive_options.c @@ -87,6 +87,8 @@ _archive_set_either_option(struct archive *a, const char *m, const char *o, cons if (r2 == ARCHIVE_FATAL) return (ARCHIVE_FATAL); + if (r2 == ARCHIVE_WARN - 1) + return r1; return r1 > r2 ? r1 : r2; } diff --git a/libarchive/archive_write_set_options.c b/libarchive/archive_write_set_options.c index 2e1798421..962309ada 100644 --- a/libarchive/archive_write_set_options.c +++ b/libarchive/archive_write_set_options.c @@ -78,7 +78,7 @@ archive_set_format_option(struct archive *_a, const char *m, const char *o, struct archive_write *a = (struct archive_write *)_a; if (a->format_name == NULL) - return (ARCHIVE_FAILED); + return (m == NULL)?ARCHIVE_FAILED:ARCHIVE_WARN - 1; /* If the format name didn't match, return a special code for * _archive_set_option[s]. */ if (m != NULL && strcmp(m, a->format_name) != 0) -- 2.47.2