diff options
author | Brad King <brad.king@kitware.com> | 2013-07-26 20:08:54 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2013-07-31 12:19:13 (GMT) |
commit | 102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6 (patch) | |
tree | db05ed527f04506957049a7b087be6c038d98435 /Utilities/cmlibarchive/libarchive/archive_write_set_options.c | |
parent | 87402c995ed2460deb2f39e02acf77a0bb57f263 (diff) | |
parent | 35df7c8ba8854e97bd6994c4d1143f57535ed6f2 (diff) | |
download | CMake-102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6.zip CMake-102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6.tar.gz CMake-102071f80cf4ad7aa97bf8a1618cfc6ee6689ab6.tar.bz2 |
Merge branch 'libarchive-upstream' into update-libarchive
Conflicts:
Utilities/cmlibarchive/CMakeLists.txt
Utilities/cmlibarchive/libarchive/archive.h
Utilities/cmlibarchive/libarchive/archive_entry.h
Utilities/cmlibarchive/libarchive/archive_read_disk_posix.c
Utilities/cmlibarchive/libarchive/archive_read_support_format_iso9660.c
Utilities/cmlibarchive/libarchive/archive_windows.h
Utilities/cmlibarchive/libarchive/archive_write_set_format_iso9660.c
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_write_set_options.c')
-rw-r--r-- | Utilities/cmlibarchive/libarchive/archive_write_set_options.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_options.c b/Utilities/cmlibarchive/libarchive/archive_write_set_options.c index a8c2d23..962309a 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_set_options.c +++ b/Utilities/cmlibarchive/libarchive/archive_write_set_options.c @@ -78,11 +78,13 @@ 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) - return (ARCHIVE_FAILED); + return (ARCHIVE_WARN - 1); if (a->format_options == NULL) - return (ARCHIVE_FAILED); + return (ARCHIVE_WARN); return a->format_options(a, o, v); } @@ -92,7 +94,7 @@ archive_set_filter_option(struct archive *_a, const char *m, const char *o, { struct archive_write *a = (struct archive_write *)_a; struct archive_write_filter *filter; - int r, rv = ARCHIVE_FAILED; + int r, rv = ARCHIVE_WARN; for (filter = a->filter_first; filter != NULL; filter = filter->next_filter) { if (filter->options == NULL) @@ -111,6 +113,10 @@ archive_set_filter_option(struct archive *_a, const char *m, const char *o, if (r == ARCHIVE_OK) rv = ARCHIVE_OK; } + /* If the filter name didn't match, return a special code for + * _archive_set_option[s]. */ + if (rv == ARCHIVE_WARN && m != NULL) + rv = ARCHIVE_WARN - 1; return (rv); } |