]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Do not return "Unknown module name" error when a format name matches
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Fri, 30 Nov 2012 01:21:28 +0000 (10:21 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Fri, 30 Nov 2012 01:21:28 +0000 (10:21 +0900)
a specfied module name and the option name is wrong and filter names
do not matche the specfied module name.

libarchive/archive_options.c
libarchive/archive_write_set_options.c

index 0da814926b6c6004880940f04a5e442a4ca930fc..8af623931f016ae0fbe258e38fe7896748703404 100644 (file)
@@ -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;
 }
 
index 2e17984216a2449b6c3df7b1d29522351e810488..962309ada5ce8ef6b2dbdec387ac8daa776e0d4d 100644 (file)
@@ -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)