]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_urlglob.c: partly reverse dc19789444
authorDaniel Stenberg <daniel@haxx.se>
Mon, 15 Dec 2014 23:51:22 +0000 (00:51 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 15 Dec 2014 23:51:39 +0000 (00:51 +0100)
The loop in glob_next_url() needs to be done backwards to maintain the
logic. dc19789444 caused test 1235 to fail.

src/tool_urlglob.c

index 5a7fbe0c7d19d10b86b92075986e917a43f430f6..bfbb781eeaf91cfd62e517105175f143dd3b372d 100644 (file)
@@ -495,9 +495,9 @@ int glob_next_url(char **globbed, URLGlob *glob)
   else {
     bool carry = TRUE;
 
-    /* implement a counter over the index ranges of all patterns,
-       starting with the leftmost pattern */
-    for(i = 0; carry && (i < glob->size); i++) {
+    /* implement a counter over the index ranges of all patterns, starting
+       with the rightmost pattern */
+    for(i = glob->size - 1; carry && (i < glob->size); --i) {
       carry = FALSE;
       pat = &glob->pattern[i];
       switch (pat->type) {