diff options
author | kientzle <kientzle@FreeBSD.org> | 2009-06-20 06:02:21 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2009-06-20 06:02:21 +0000 |
commit | 19f69f425d4d9a3f52ef042e1b20bed21a633b47 (patch) | |
tree | a237a07d853b2c72d511d459342d6f1a4ff4f8c3 /lib/libarchive/archive_read.c | |
parent | 1c7681de495de3c57caec43f08bcbee01d195ee3 (diff) | |
download | FreeBSD-src-19f69f425d4d9a3f52ef042e1b20bed21a633b47.zip FreeBSD-src-19f69f425d4d9a3f52ef042e1b20bed21a633b47.tar.gz |
Fix "tar --options=iso9660:joliet" and other uses
of format-specific options.
Diffstat (limited to 'lib/libarchive/archive_read.c')
-rw-r--r-- | lib/libarchive/archive_read.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libarchive/archive_read.c b/lib/libarchive/archive_read.c index 29e70fe..9274d66 100644 --- a/lib/libarchive/archive_read.c +++ b/lib/libarchive/archive_read.c @@ -117,6 +117,7 @@ archive_read_set_format_options(struct archive *_a, const char *s) struct archive_read *a; struct archive_format_descriptor *format; char key[64], val[64]; + char *valp; size_t i; int len, r; @@ -135,10 +136,10 @@ archive_read_set_format_options(struct archive *_a, const char *s) while ((len = __archive_parse_options(s, format->name, sizeof(key), key, sizeof(val), val)) > 0) { - if (val[0] == '\0') - r = format->options(a, key, NULL); - else - r = format->options(a, key, val); + valp = val[0] == '\0' ? NULL : val; + a->format = format; + r = format->options(a, key, valp); + a->format = NULL; if (r == ARCHIVE_FATAL) return (r); s += len; |