From: Tim Kientzle Date: Sat, 20 Jun 2009 06:00:30 +0000 (-0400) Subject: Fix "tar --options=iso9660:joliet" and other uses of X-Git-Tag: v2.8.0~577 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b9d04231fc3017147b672b45478a3f238a812838;p=thirdparty%2Flibarchive.git Fix "tar --options=iso9660:joliet" and other uses of format options. SVN-Revision: 1172 --- diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c index 858f8ee07..f24e2c278 100644 --- a/libarchive/archive_read.c +++ b/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;