From: Michihiro NAKAJIMA Date: Fri, 30 Nov 2012 01:21:28 +0000 (+0900) Subject: Do not return "Unknown module name" error when a format name matches X-Git-Tag: v3.1.0~39^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=39df0279539b519ad83ae12a5dedd50e6ecdc5d1;p=thirdparty%2Flibarchive.git 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. --- 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)