{
struct archive_write *a = (struct archive_write *)_a;
char key[64], val[64];
- int len, r;
+ int len, r, ret = ARCHIVE_OK;
+ if (s == NULL || *s == '\0')
+ return (ARCHIVE_OK);
if (a->format_options == NULL)
/* This format does not support option. */
return (ARCHIVE_OK);
r = a->format_options(a, key, val);
if (r == ARCHIVE_FATAL)
return (r);
+ if (r < ARCHIVE_OK) { /* This key was not handled. */
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Unsupported option ``%s''", key);
+ ret = ARCHIVE_WARN;
+ }
s += len;
}
if (len < 0) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Illegal format options.");
+ "Malformed options string.");
return (ARCHIVE_WARN);
}
- return (ARCHIVE_OK);
+ return (ret);
}
/*
struct archive_write *a = (struct archive_write *)_a;
char key[64], val[64];
int len, r;
+ int ret = ARCHIVE_OK;
+ if (s == NULL || *s == '\0')
+ return (ARCHIVE_OK);
if (a->compressor.options == NULL)
/* This compressor does not support option. */
return (ARCHIVE_OK);
r = a->compressor.options(a, key, val);
if (r == ARCHIVE_FATAL)
return (r);
+ if (r < ARCHIVE_OK) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Unsupported option ``%s''", key);
+ ret = ARCHIVE_WARN;
+ }
s += len;
}
if (len < 0) {
"Illegal format options.");
return (ARCHIVE_WARN);
}
- return (ARCHIVE_OK);
+ return (ret);
}
/*