Browse files

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.
  • Loading branch information...
1 parent a875bd4 commit 39df0279539b519ad83ae12a5dedd50e6ecdc5d1 @ggcueroad ggcueroad committed Nov 30, 2012
Showing with 3 additions and 1 deletion.
  1. +2 −0 libarchive/archive_options.c
  2. +1 −1 libarchive/archive_write_set_options.c
View
2 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;
}
View
2 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)

0 comments on commit 39df027

Please sign in to comment.