]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
code: minor indent fixes before closing braces
authorDaniel Stenberg <daniel@haxx.se>
Thu, 13 Nov 2025 12:50:49 +0000 (13:50 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 13 Nov 2025 16:27:40 +0000 (17:27 +0100)
Closes #19512

16 files changed:
docs/examples/ghiper.c
lib/http2.c
lib/if2ip.h
lib/strcase.c
lib/vtls/gtls.c
lib/vtls/mbedtls.c
lib/vtls/wolfssl.c
packages/OS400/ccsidcurl.c
packages/OS400/curlmain.c
src/tool_formparse.c
src/tool_getparam.c
src/tool_getpass.c
tests/unit/unit1603.c
tests/unit/unit1651.c
tests/unit/unit1656.c
tests/unit/unit1660.c

index 61771c7ad7bb05a86bff67140583c3990a5df2b2..45c129faea09ab8a4557e9bf7c9cddb2fb193e57 100644 (file)
@@ -101,14 +101,27 @@ static void mcode_or_die(const char *where, CURLMcode code)
   if(CURLM_OK != code) {
     const char *s;
     switch(code) {
-    case     CURLM_BAD_HANDLE:         s = "CURLM_BAD_HANDLE";         break;
-    case     CURLM_BAD_EASY_HANDLE:    s = "CURLM_BAD_EASY_HANDLE";    break;
-    case     CURLM_OUT_OF_MEMORY:      s = "CURLM_OUT_OF_MEMORY";      break;
-    case     CURLM_INTERNAL_ERROR:     s = "CURLM_INTERNAL_ERROR";     break;
-    case     CURLM_BAD_SOCKET:         s = "CURLM_BAD_SOCKET";         break;
-    case     CURLM_UNKNOWN_OPTION:     s = "CURLM_UNKNOWN_OPTION";     break;
-    case     CURLM_LAST:               s = "CURLM_LAST";               break;
-    default: s = "CURLM_unknown";
+    case CURLM_BAD_HANDLE:
+      s = "CURLM_BAD_HANDLE";
+      break;
+    case CURLM_BAD_EASY_HANDLE:
+      s = "CURLM_BAD_EASY_HANDLE";
+      break;
+    case CURLM_OUT_OF_MEMORY:
+      s = "CURLM_OUT_OF_MEMORY";
+      break;
+    case CURLM_INTERNAL_ERROR:
+      s = "CURLM_INTERNAL_ERROR";
+      break;
+    case CURLM_BAD_SOCKET:
+      s = "CURLM_BAD_SOCKET";
+      break;
+    case CURLM_UNKNOWN_OPTION:
+      s = "CURLM_UNKNOWN_OPTION";
+      break;
+    default:
+      s = "CURLM_unknown";
+      break;
     }
     MSG_OUT("ERROR: %s returns %s\n", where, s);
     exit(code);
index 5c8b0cab3886f014a0618d1e8d8a0f651f9e37ba..68446d5177afa6b01a7b2ba1de9c8b99f0ae756b 100644 (file)
@@ -716,7 +716,7 @@ static CURLcode http2_send_ping(struct Curl_cfilter *cf,
   if(rc) {
     failf(data, "nghttp2_submit_ping() failed: %s(%d)",
           nghttp2_strerror(rc), rc);
-   return CURLE_HTTP2;
+    return CURLE_HTTP2;
   }
 
   rc = nghttp2_session_send(ctx->h2);
index b33e41aebd0b4fb756652b41b66b97dd70ecab26..42ec7b033a8cc0b5569c165dfd66975bc7dae42e 100644 (file)
@@ -62,15 +62,15 @@ struct ifreq {
     char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
   } ifr_ifrn;
 
- union {
-   struct sockaddr ifru_addr;
-   struct sockaddr ifru_broadaddr;
-   struct sockaddr ifru_netmask;
-   struct sockaddr ifru_hwaddr;
-   short ifru_flags;
-   int ifru_metric;
-   int ifru_mtu;
- } ifr_ifru;
 union {
+    struct sockaddr ifru_addr;
+    struct sockaddr ifru_broadaddr;
+    struct sockaddr ifru_netmask;
+    struct sockaddr ifru_hwaddr;
+    short ifru_flags;
+    int ifru_metric;
+    int ifru_mtu;
 } ifr_ifru;
 };
 
 /* This define exists to avoid an extra #ifdef INTERIX in the C code. */
index ee5b9072c4cc1b391dfc177b9b8423150f674834..78d4dc5b3d93a8d29b72f3c2be980a6a57fc7e36 100644 (file)
 
 /* Mapping table to go from lowercase to uppercase for plain ASCII.*/
 static const unsigned char touppermap[256] = {
-0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
-22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
-41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
-60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
-79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 65,
-66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
-85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133,
-134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
-150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165,
-166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,
-182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197,
-198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,
-214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
-230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245,
-246, 247, 248, 249, 250, 251, 252, 253, 254, 255
+  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
+  22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+  41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+  60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
+  79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 65,
+  66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+  85, 86, 87, 88, 89, 90, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132,
+  133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147,
+  148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162,
+  163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177,
+  178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192,
+  193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
+  208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222,
+  223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237,
+  238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252,
+  253, 254, 255
 };
 
 /* Mapping table to go from uppercase to lowercase for plain ASCII.*/
 static const unsigned char tolowermap[256] = {
-0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
-22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
-42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
-62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
-111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92, 93, 94, 95,
-96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,
-112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127,
-128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
-144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159,
-160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 173, 174, 175,
-176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191,
-192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,
-208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223,
-224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239,
-240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
+  0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
+  22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+  41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
+  60, 61, 62, 63, 64, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
+  109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 91, 92,
+  93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109,
+  110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
+  125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,
+  140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154,
+  155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168, 169,
+  170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
+  185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199,
+  200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214,
+  215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229,
+  230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244,
+  245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255
 };
 
 
index a692ce31c72911380b27a46d839d996ad763a74d..4ac6bad0163d2b41adf3ce643febea5399779c48 100644 (file)
@@ -346,7 +346,7 @@ gnutls_set_ssl_version_min_max(struct Curl_easy *data,
     if(ssl_version_max < CURL_SSLVERSION_MAX_TLSv1_3) {
       failf(data, "QUIC needs at least TLS version 1.3");
       return CURLE_SSL_CONNECT_ERROR;
-     }
+    }
     *prioritylist = QUIC_PRIORITY;
     return CURLE_OK;
   }
index f5302499bdd74d2173d86352b7ddd5bf94fe49d5..9a307499595a2f182b0f4c02790aa10d3d56624b 100644 (file)
@@ -1350,6 +1350,7 @@ static CURLcode mbed_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
   if(nread > 0)
     *pnread = (size_t)nread;
   else {
+    char errorbuf[128];
     CURL_TRC_CF(data, cf, "mbedtls_ssl_read(len=%zu) -> -0x%04X",
                 buffersize, -nread);
     switch(nread) {
@@ -1369,14 +1370,12 @@ static CURLcode mbed_recv(struct Curl_cfilter *cf, struct Curl_easy *data,
     case MBEDTLS_ERR_SSL_PEER_CLOSE_NOTIFY:
       result = CURLE_OK;
       break;
-    default: {
-      char errorbuf[128];
+    default:
       mbedtls_strerror(nread, errorbuf, sizeof(errorbuf));
       failf(data, "ssl_read returned: (-0x%04X) %s", -nread, errorbuf);
       result = CURLE_RECV_ERROR;
       break;
     }
-    }
   }
   return result;
 }
index 9d6b094ff11acde020bebf3a5157f821757eb2a5..a7883fe08a2f0542b86ea5a747d89bd1afc43673 100644 (file)
@@ -868,9 +868,9 @@ CURLcode Curl_wssl_setup_x509_store(struct Curl_cfilter *cf,
     }
   }
   else {
-   /* We never share the CTX's store, use it. */
-   WOLFSSL_X509_STORE *store = wolfSSL_CTX_get_cert_store(wssl->ssl_ctx);
-   result = wssl_populate_x509_store(cf, data, store, wssl);
+    /* We never share the CTX's store, use it. */
+    WOLFSSL_X509_STORE *store = wolfSSL_CTX_get_cert_store(wssl->ssl_ctx);
+    result = wssl_populate_x509_store(cf, data, store, wssl);
   }
 
   return result;
@@ -1389,8 +1389,8 @@ CURLcode Curl_wssl_ctx_init(struct wssl_ctx *wctx,
         }
       }
       else {
-       trying_ech_now = 1;
-       infof(data, "ECH: ECHConfig from command line");
+        trying_ech_now = 1;
+        infof(data, "ECH: ECHConfig from command line");
       }
     }
     else {
index 76b182cf172438cebe8803250bb039d5657965e3..b176def67d1855c79b75450bfe8692e7e3ec65bb 100644 (file)
@@ -296,7 +296,7 @@ curl_easy_escape_ccsid(CURL *handle, const char *string, int length,
     /* !checksrc! disable ERRNOVAR 1 */
     errno = EINVAL;
     return (char *) NULL;
-    }
+  }
 
   s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid, NULL);
 
@@ -327,7 +327,7 @@ curl_easy_unescape_ccsid(CURL *handle, const char *string, int length,
     /* !checksrc! disable ERRNOVAR 1 */
     errno = EINVAL;
     return (char *) NULL;
-    }
+  }
 
   s = dynconvert(ASCII_CCSID, string, length ? length : -1, sccsid, NULL);
 
@@ -728,7 +728,7 @@ Curl_formadd_convert(struct curl_forms *forms,
   if(l < 0) {
     free(cp);
     return -1;
-    }
+  }
 
   cp2 = realloc(cp, l);         /* Shorten buffer to the string size. */
 
@@ -810,10 +810,10 @@ curl_formadd_ccsid(struct curl_httppost **httppost,
       if(!tforms) {
         result = CURL_FORMADD_MEMORY;
         break;
-        }
+      }
 
       lforms = tforms;
-      }
+    }
 
     /* Get next option. */
 
@@ -823,7 +823,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost,
       option = forms->option;
       value = forms->value;
       forms++;
-      }
+    }
     else {
       /* Get option from arguments. */
 
@@ -845,7 +845,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost,
       if(!forms) {
         forms = va_arg(arg, struct curl_forms *);
         continue;
-        }
+      }
 
       result = CURL_FORMADD_ILLEGAL_ARRAY;
       break;
@@ -862,11 +862,11 @@ curl_formadd_ccsid(struct curl_httppost **httppost,
       if(!forms) {
         value = va_arg(arg, char *);
         nameccsid = (unsigned int) va_arg(arg, long);
-        }
+      }
       else {
         nameccsid = (unsigned int) forms->value;
         forms++;
-        }
+      }
 
       break;
 
@@ -879,11 +879,11 @@ curl_formadd_ccsid(struct curl_httppost **httppost,
       if(!forms) {
         value = va_arg(arg, char *);
         contentccsid = (unsigned int) va_arg(arg, long);
-        }
+      }
       else {
         contentccsid = (unsigned int) forms->value;
         forms++;
-        }
+      }
 
       break;
 
@@ -942,7 +942,7 @@ curl_formadd_ccsid(struct curl_httppost **httppost,
       if(Curl_formadd_convert(lforms, contentx, lengthx, contentccsid) < 0) {
         result = CURL_FORMADD_MEMORY;
         break;
-        }
+      }
 
       contentx = -1;
       lengthx = -1;
@@ -954,16 +954,16 @@ curl_formadd_ccsid(struct curl_httppost **httppost,
       if(!Curl_is_formadd_string(option)) {
         result = CURL_FORMADD_UNKNOWN_OPTION;
         break;
-        }
+      }
 
       if(!forms) {
         value = va_arg(arg, char *);
         ccsid = (unsigned int) va_arg(arg, long);
-        }
+      }
       else {
         ccsid = (unsigned int) forms->value;
         forms++;
-        }
+      }
 
       /* Do the conversion. */
 
@@ -972,17 +972,17 @@ curl_formadd_ccsid(struct curl_httppost **httppost,
       if(Curl_formadd_convert(lforms, nargs, -1, ccsid) < 0) {
         result = CURL_FORMADD_MEMORY;
         break;
-        }
+      }
 
       value = lforms[nargs].value;
-      }
+    }
 
     if(result != CURL_FORMADD_OK)
       break;
 
     lforms[nargs].value = value;
     lforms[nargs++].option = option;
-    }
+  }
 
   va_end(arg);
 
@@ -1047,7 +1047,7 @@ Curl_formget_callback_ccsid(void *arg, const char *buf, size_t len)
   if(l < 0) {
     free(b);
     return (size_t) -1;
-    }
+  }
 
   ret = (*p->append)(p->arg, b, l);
   free(b);
index 079b9b0d9dcda2e52844d14f894b664cca7bbd89..19328f7c844679ea77d2d009ec642cfd6fe6a8e9 100644 (file)
@@ -85,7 +85,7 @@ int main(int argc, char **argv)
 
     /* Reset the shift state. */
     iconv(cd, NULL, &inbytesleft, &outbuf, &outbytesleft);
-   }
+  }
 
   /* Allocate memory for the ASCII arguments and vector. */
   argv = (char **) malloc((argc + 1) * sizeof(*argv) + bytecount);
index 004ad6ff4c70b7e9e6dfd352dfadfd2d756f808d..1d127a584286451adaae517d5046774b6fc1a8fa 100644 (file)
@@ -116,7 +116,7 @@ static struct tool_mime *tool_mime_new_filedata(struct tool_mime *parent,
         m->data = filedup;
         if(!isremotefile)
           m->kind = TOOLMIME_FILEDATA;
-       *errcode = CURLE_OK;
+        *errcode = CURLE_OK;
       }
     }
   }
index 8d5d89a7526118048f67464d83697c2f71e60a9f..b74b73806d2c19cc32ab7ee2542a3285c6d7feb2 100644 (file)
@@ -1654,15 +1654,15 @@ static ParameterError parse_upload_flags(struct OperationConfig *config,
       }
     }
 
-   if(!map->name) {
-     err = PARAM_OPTION_UNKNOWN;
-     break;
-   }
-
-   if(next)
-     /* move over the comma */
-     next++;
-   flag = next;
+    if(!map->name) {
+      err = PARAM_OPTION_UNKNOWN;
+      break;
+    }
+
+    if(next)
+      /* move over the comma */
+      next++;
+    flag = next;
   }
 
   return err;
index a92fb7594c78bf83edefee1daefbe7b07b331f4f..a4dea347efe0f7d2025fb08ec110e74eea3fe789 100644 (file)
@@ -60,15 +60,12 @@ char *getpass_r(const char *prompt, char *buffer, size_t buflen)
   long sts;
   short chan;
 
-  /* MSK, 23-JAN-2004, iosbdef.h was not in VAX V7.2 or CC 6.4  */
-  /* distribution so I created this. May revert back later to */
-  /* struct _iosb iosb;                                        */
-  struct _iosb
-     {
-     short int iosb$w_status; /* status     */
-     short int iosb$w_bcnt;   /* byte count */
-     int       unused;        /* unused     */
-     } iosb;
+  /* iosbdef.h was not in VAX V7.2 or CC 6.4  */
+  struct _isb {
+    short int iosb$w_status; /* status     */
+    short int iosb$w_bcnt;   /* byte count */
+    int unused;              /* unused     */
+  } iosb;
 
   $DESCRIPTOR(ttdesc, "TT");
 
index d59b458d57933c9f6e465a36c9d42d7419fd8f8b..b4ec152936ee80ea01e7f9d3b8ff9fcbab11c8be 100644 (file)
@@ -32,7 +32,7 @@ static const size_t slots = 3;
 static void t1603_mydtor(void *p)
 {
   /* Data are statically allocated */
- (void)p;
 (void)p;
 }
 
 static size_t elem_dtor_calls;
index 5ebce7aabdad020439c2428fc0477f5b2423425a..a038caacbd7f350cc7ad4a15d97a0e8f1c5c5051 100644 (file)
@@ -32,7 +32,8 @@ static CURLcode test_unit1651(const char *arg)
 #if defined(USE_GNUTLS) || defined(USE_SCHANNEL)
 
   /* cert captured from gdb when connecting to curl.se on October 26
-     2018 */
+     2018.
+     !checksrc! disable CLOSEBRACE 1 */
   static unsigned char cert[] = {
   0x30, 0x82, 0x0F, 0x5B, 0x30, 0x82, 0x0E, 0x43, 0xA0, 0x03, 0x02, 0x01, 0x02,
   0x02, 0x0C, 0x08, 0x77, 0x99, 0x2C, 0x6B, 0x67, 0xE1, 0x18, 0xD6, 0x66, 0x66,
index 520a430fe930e05be11fd147a224f4fec6a5f115..98e25b7c22a174b7ce892d77e50612f8fa6755e4 100644 (file)
@@ -61,32 +61,34 @@ static CURLcode test_unit1656(const char *arg)
   UNITTEST_BEGIN_SIMPLE
 
   static const struct test_spec test_specs[] = {
-  { "190321134340", "1903-21-13 43:40:00", CURLE_OK },
-  { "", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
-  { "WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
-  { "0WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
-  { "19032113434", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
-  { "19032113434WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
-  { "190321134340.", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
-  { "190321134340.1", "1903-21-13 43:40:00.1", CURLE_OK },
-  { "19032113434017.0", "1903-21-13 43:40:17", CURLE_OK },
-  { "19032113434017.01", "1903-21-13 43:40:17.01", CURLE_OK },
-  { "19032113434003.001", "1903-21-13 43:40:03.001", CURLE_OK },
-  { "19032113434003.090", "1903-21-13 43:40:03.09", CURLE_OK },
-  { "190321134340Z", "1903-21-13 43:40:00 GMT", CURLE_OK },
-  { "19032113434017.0Z", "1903-21-13 43:40:17 GMT", CURLE_OK },
-  { "19032113434017.01Z", "1903-21-13 43:40:17.01 GMT", CURLE_OK },
-  { "19032113434003.001Z", "1903-21-13 43:40:03.001 GMT", CURLE_OK },
-  { "19032113434003.090Z", "1903-21-13 43:40:03.09 GMT", CURLE_OK },
-  { "190321134340CET", "1903-21-13 43:40:00 CET", CURLE_OK },
-  { "19032113434017.0CET", "1903-21-13 43:40:17 CET", CURLE_OK },
-  { "19032113434017.01CET", "1903-21-13 43:40:17.01 CET", CURLE_OK },
-  { "190321134340+02:30", "1903-21-13 43:40:00 UTC+02:30", CURLE_OK },
-  { "19032113434017.0+02:30", "1903-21-13 43:40:17 UTC+02:30", CURLE_OK },
-  { "19032113434017.01+02:30", "1903-21-13 43:40:17.01 UTC+02:30", CURLE_OK },
-  { "190321134340-3", "1903-21-13 43:40:00 UTC-3", CURLE_OK },
-  { "19032113434017.0-04", "1903-21-13 43:40:17 UTC-04", CURLE_OK },
-  { "19032113434017.01-01:10", "1903-21-13 43:40:17.01 UTC-01:10", CURLE_OK },
+    { "190321134340", "1903-21-13 43:40:00", CURLE_OK },
+    { "", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
+    { "WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
+    { "0WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
+    { "19032113434", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
+    { "19032113434WTF", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
+    { "190321134340.", NULL, CURLE_BAD_FUNCTION_ARGUMENT },
+    { "190321134340.1", "1903-21-13 43:40:00.1", CURLE_OK },
+    { "19032113434017.0", "1903-21-13 43:40:17", CURLE_OK },
+    { "19032113434017.01", "1903-21-13 43:40:17.01", CURLE_OK },
+    { "19032113434003.001", "1903-21-13 43:40:03.001", CURLE_OK },
+    { "19032113434003.090", "1903-21-13 43:40:03.09", CURLE_OK },
+    { "190321134340Z", "1903-21-13 43:40:00 GMT", CURLE_OK },
+    { "19032113434017.0Z", "1903-21-13 43:40:17 GMT", CURLE_OK },
+    { "19032113434017.01Z", "1903-21-13 43:40:17.01 GMT", CURLE_OK },
+    { "19032113434003.001Z", "1903-21-13 43:40:03.001 GMT", CURLE_OK },
+    { "19032113434003.090Z", "1903-21-13 43:40:03.09 GMT", CURLE_OK },
+    { "190321134340CET", "1903-21-13 43:40:00 CET", CURLE_OK },
+    { "19032113434017.0CET", "1903-21-13 43:40:17 CET", CURLE_OK },
+    { "19032113434017.01CET", "1903-21-13 43:40:17.01 CET", CURLE_OK },
+    { "190321134340+02:30", "1903-21-13 43:40:00 UTC+02:30", CURLE_OK },
+    { "19032113434017.0+02:30", "1903-21-13 43:40:17 UTC+02:30", CURLE_OK },
+    { "19032113434017.01+02:30", "1903-21-13 43:40:17.01 UTC+02:30",
+      CURLE_OK },
+    { "190321134340-3", "1903-21-13 43:40:00 UTC-3", CURLE_OK },
+    { "19032113434017.0-04", "1903-21-13 43:40:17 UTC-04", CURLE_OK },
+    { "19032113434017.01-01:10", "1903-21-13 43:40:17.01 UTC-01:10",
+      CURLE_OK },
   };
 
   size_t i;
index e74285d74ec451d9c7f1bbd092bc3becc66a8a76..cbb78202150df1d8d61686269a550ae9620f0f16 100644 (file)
@@ -58,56 +58,56 @@ static CURLcode test_unit1660(const char *arg)
   };
 
   static const struct testit headers[] = {
-  /* two entries read from disk cache, verify first */
-  { "-", "readfrom.example", NULL, CURLE_OK},
-  { "-", "old.example", NULL, CURLE_OK},
-  /* delete the remaining one read from disk */
-  { "readfrom.example", NULL, "max-age=\"0\"", CURLE_OK},
-
-  { "example.com", NULL, "max-age=\"31536000\"\r\n", CURLE_OK },
-  { "example.com", NULL, "max-age=\"21536000\"\r\n", CURLE_OK },
-  { "example.com", NULL, "max-age=\"21536000\"; \r\n", CURLE_OK },
-  { "example.com", NULL, "max-age=\"21536000\"; includeSubDomains\r\n",
-    CURLE_OK },
-  { "example.org", NULL, "max-age=\"31536000\"\r\n", CURLE_OK },
-  { "this.example", NULL, "max=\"31536\";", CURLE_BAD_FUNCTION_ARGUMENT },
-  { "this.example", NULL, "max-age=\"31536", CURLE_BAD_FUNCTION_ARGUMENT },
-  { "this.example", NULL, "max-age=31536\"", CURLE_OK },
-  /* max-age=0 removes the entry */
-  { "this.example", NULL, "max-age=0", CURLE_OK },
-  { "another.example", NULL, "includeSubDomains; ",
-    CURLE_BAD_FUNCTION_ARGUMENT },
-
-  /* Two max-age is illegal */
-  { "example.com", NULL,
-    "max-age=\"21536000\"; includeSubDomains; max-age=\"3\";",
-    CURLE_BAD_FUNCTION_ARGUMENT },
-  /* Two includeSubDomains is illegal */
-  { "2.example.com", NULL,
-    "max-age=\"21536000\"; includeSubDomains; includeSubDomains;",
-    CURLE_BAD_FUNCTION_ARGUMENT },
-  /* use an unknown directive "include" that should be ignored */
-  { "3.example.com", NULL, "max-age=\"21536000\"; include; includeSubDomains;",
-    CURLE_OK },
-  /* remove the "3.example.com" one, should still match the example.com */
-  { "3.example.com", NULL, "max-age=\"0\"; includeSubDomains;",
-    CURLE_OK },
-  { "-", "foo.example.com", NULL, CURLE_OK},
-  { "-", "foo.xample.com", NULL, CURLE_OK},
-
-  /* should not match */
-  { "example.net", "forexample.net", "max-age=\"31536000\"\r\n", CURLE_OK },
-
-  /* should not match either, since forexample.net is not in the example.net
-     domain */
-  { "example.net", "forexample.net",
-    "max-age=\"31536000\"; includeSubDomains\r\n", CURLE_OK },
-  /* remove example.net again */
-  { "example.net", NULL, "max-age=\"0\"; includeSubDomains\r\n", CURLE_OK },
-
-  /* make this live for 7 seconds */
-  { "expire.example", NULL, "max-age=\"7\"\r\n", CURLE_OK },
-  { NULL, NULL, NULL, CURLE_OK }
+    /* two entries read from disk cache, verify first */
+    { "-", "readfrom.example", NULL, CURLE_OK},
+    { "-", "old.example", NULL, CURLE_OK},
+    /* delete the remaining one read from disk */
+    { "readfrom.example", NULL, "max-age=\"0\"", CURLE_OK},
+
+    { "example.com", NULL, "max-age=\"31536000\"\r\n", CURLE_OK },
+    { "example.com", NULL, "max-age=\"21536000\"\r\n", CURLE_OK },
+    { "example.com", NULL, "max-age=\"21536000\"; \r\n", CURLE_OK },
+    { "example.com", NULL, "max-age=\"21536000\"; includeSubDomains\r\n",
+      CURLE_OK },
+    { "example.org", NULL, "max-age=\"31536000\"\r\n", CURLE_OK },
+    { "this.example", NULL, "max=\"31536\";", CURLE_BAD_FUNCTION_ARGUMENT },
+    { "this.example", NULL, "max-age=\"31536", CURLE_BAD_FUNCTION_ARGUMENT },
+    { "this.example", NULL, "max-age=31536\"", CURLE_OK },
+    /* max-age=0 removes the entry */
+    { "this.example", NULL, "max-age=0", CURLE_OK },
+    { "another.example", NULL, "includeSubDomains; ",
+      CURLE_BAD_FUNCTION_ARGUMENT },
+
+    /* Two max-age is illegal */
+    { "example.com", NULL,
+      "max-age=\"21536000\"; includeSubDomains; max-age=\"3\";",
+      CURLE_BAD_FUNCTION_ARGUMENT },
+    /* Two includeSubDomains is illegal */
+    { "2.example.com", NULL,
+      "max-age=\"21536000\"; includeSubDomains; includeSubDomains;",
+      CURLE_BAD_FUNCTION_ARGUMENT },
+    /* use an unknown directive "include" that should be ignored */
+    { "3.example.com", NULL,
+      "max-age=\"21536000\"; include; includeSubDomains;", CURLE_OK },
+    /* remove the "3.example.com" one, should still match the example.com */
+    { "3.example.com", NULL, "max-age=\"0\"; includeSubDomains;",
+      CURLE_OK },
+    { "-", "foo.example.com", NULL, CURLE_OK},
+    { "-", "foo.xample.com", NULL, CURLE_OK},
+
+    /* should not match */
+    { "example.net", "forexample.net", "max-age=\"31536000\"\r\n", CURLE_OK },
+
+    /* should not match either, since forexample.net is not in the example.net
+       domain */
+    { "example.net", "forexample.net",
+      "max-age=\"31536000\"; includeSubDomains\r\n", CURLE_OK },
+    /* remove example.net again */
+    { "example.net", NULL, "max-age=\"0\"; includeSubDomains\r\n", CURLE_OK },
+
+    /* make this live for 7 seconds */
+    { "expire.example", NULL, "max-age=\"7\"\r\n", CURLE_OK },
+    { NULL, NULL, NULL, CURLE_OK }
   };
 
   CURLcode result;