]> granicus.if.org Git - xz/commitdiff
Fix options parsing bug in xz.
authorLasse Collin <lasse.collin@tukaani.org>
Tue, 1 Sep 2009 17:23:30 +0000 (20:23 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Tue, 1 Sep 2009 17:23:30 +0000 (20:23 +0300)
xz used to reject "xz --lzma2=pb=2," while
"xz --lzma2=pb=2,," worked. Now both work.

src/xz/options.c

index 8ac6750403fdcfb928b5830ba50160aa7f2b7493..c52f61e06483d17e1d90d099b8f95af3ffdbda8b 100644 (file)
@@ -68,11 +68,9 @@ parse_options(const char *str, const option_map *opts,
        char *s = xstrdup(str);
        char *name = s;
 
-       while (true) {
+       while (*name != '\0') {
                if (*name == ',') {
-                       if (*++name == '\0')
-                               break;
-
+                       ++name;
                        continue;
                }