]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
glob_next_url: make the loop count upwards
authorDaniel Stenberg <daniel@haxx.se>
Tue, 16 Dec 2014 08:01:56 +0000 (09:01 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 16 Dec 2014 08:01:56 +0000 (09:01 +0100)
As the former contruct apparently caused a compiler warning, mentioned
in d8efde07e556c.

src/tool_urlglob.c

index 3128044ba6c4f5acd235701cf206ef74fa7a5e98..b6d5591abd490161ecb9a09de908e5213d6366a0 100644 (file)
@@ -494,9 +494,9 @@ CURLcode glob_next_url(char **globbed, URLGlob *glob)
 
     /* 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) {
+    for(i = 0; carry && (i < glob->size); i++) {
       carry = FALSE;
-      pat = &glob->pattern[i];
+      pat = &glob->pattern[glob->size - 1 - i];
       switch (pat->type) {
       case UPTSet:
         if((pat->content.Set.elements) &&