Author: kientzle
Date: Sat Jun 20 06:02:21 2009
New Revision: 194525
URL: http://svn.freebsd.org/changeset/base/194525

Log:
  Fix "tar --options=iso9660:joliet" and other uses
  of format-specific options.

Modified:
  head/lib/libarchive/archive_read.c

Modified: head/lib/libarchive/archive_read.c
==============================================================================
--- head/lib/libarchive/archive_read.c  Sat Jun 20 05:36:53 2009        
(r194524)
+++ head/lib/libarchive/archive_read.c  Sat Jun 20 06:02:21 2009        
(r194525)
@@ -117,6 +117,7 @@ archive_read_set_format_options(struct a
        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 a
 
                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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to