Revert "Update to 7.40.1"
[platform/upstream/curl.git] / src / tool_urlglob.c
index 943e0ab..36e83c3 100644 (file)
@@ -36,7 +36,7 @@ typedef enum {
 } GlobCode;
 
 #define GLOBERROR(string, column, code) \
-  glob->error = string, glob->pos = column, code;
+  glob->error = string, glob->pos = column, code
 
 void glob_cleanup(URLGlob* glob);
 
@@ -324,7 +324,7 @@ static bool peek_ipv6(const char *str, size_t *skip)
     }
     else if(c == ']') {
       *skip = i;
-      return colons >= 2;
+      return colons >= 2 ? TRUE : FALSE;
     }
     else {
       return FALSE;
@@ -465,6 +465,7 @@ void glob_cleanup(URLGlob* glob)
   size_t i;
   int elem;
 
+  /* the < condition is required since i underflows! */
   for(i = glob->size - 1; i < glob->size; --i) {
     if((glob->pattern[i].type == UPTSet) &&
        (glob->pattern[i].content.Set.elements)) {
@@ -498,6 +499,7 @@ int glob_next_url(char **globbed, URLGlob *glob)
 
     /* implement a counter over the index ranges of all patterns,
        starting with the rightmost pattern */
+    /* the < condition is required since i underflows! */
     for(i = glob->size - 1; carry && (i < glob->size); --i) {
       carry = FALSE;
       pat = &glob->pattern[i];