tidy-up: whitespace

Closes #21456
This commit is contained in:
Viktor Szakats 2026-04-15 23:57:35 +02:00
parent 1ea3060a25
commit 032ea65ff2
No known key found for this signature in database
5 changed files with 119 additions and 123 deletions

View file

@ -73,7 +73,7 @@ static int checkparts(CURLU *u, const char *in, const char *wanted,
/* an IPv6 numerical address host, get the zone */
(void)curl_url_get(u, CURLUPART_ZONEID, &z, getflags);
curl_msnprintf(bufp, len, "%s%s%s%s", buf[0] ? " | " : "", p,
z ? " ": "", z ? z : "");
z ? " " : "", z ? z : "");
}
else
curl_msnprintf(bufp, len, "%s[%d]", buf[0] ? " | " : "", rc);
@ -217,56 +217,57 @@ static const struct testcase get_parts_list[] = {
"http://[fe80::1%25eth0]/",
"http | [11] | [12] | [13] | [fe80::1] eth0 | [15] | / | [16] | [17]",
0, 0, CURLUE_OK },
{"curl.se",
"[10] | [11] | [12] | [13] | curl.se | [15] | / | [16] | [17]",
CURLU_GUESS_SCHEME, CURLU_NO_GUESS_SCHEME, CURLUE_OK},
{"https://curl.se:0/#",
"https | [11] | [12] | [13] | curl.se | 0 | / | [16] | ",
0, CURLU_GET_EMPTY, CURLUE_OK},
{"https://curl.se/#",
"https | [11] | [12] | [13] | curl.se | [15] | / | [16] | ",
0, CURLU_GET_EMPTY, CURLUE_OK},
{"https://curl.se/?#",
"https | [11] | [12] | [13] | curl.se | [15] | / | | ",
0, CURLU_GET_EMPTY, CURLUE_OK},
{"https://curl.se/?",
"https | [11] | [12] | [13] | curl.se | [15] | / | | [17]",
0, CURLU_GET_EMPTY, CURLUE_OK},
{"https://curl.se/?",
"https | [11] | [12] | [13] | curl.se | [15] | / | [16] | [17]",
0, 0, CURLUE_OK},
{"https://curl.se/?#",
"https | [11] | [12] | [13] | curl.se | [15] | / | [16] | [17]",
0, 0, CURLUE_OK},
{"https://curl.se/# ",
"https | [11] | [12] | [13] | curl.se | [15] | / | [16] | %20%20",
CURLU_URLENCODE | CURLU_ALLOW_SPACE, 0, CURLUE_OK},
{"", "", 0, 0, CURLUE_MALFORMED_INPUT},
{" ", "", 0, 0, CURLUE_MALFORMED_INPUT},
{"1h://example.net", "", 0, 0, CURLUE_BAD_SCHEME},
{"..://example.net", "", 0, 0, CURLUE_BAD_SCHEME},
{"-ht://example.net", "", 0, 0, CURLUE_BAD_SCHEME},
{"+ftp://example.net", "", 0, 0, CURLUE_BAD_SCHEME},
{"hej.hej://example.net",
"hej.hej | [11] | [12] | [13] | example.net | [15] | / | [16] | [17]",
CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK},
{"ht-tp://example.net",
"ht-tp | [11] | [12] | [13] | example.net | [15] | / | [16] | [17]",
CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK},
{"ftp+more://example.net",
"ftp+more | [11] | [12] | [13] | example.net | [15] | / | [16] | [17]",
CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK},
{"f1337://example.net",
"f1337 | [11] | [12] | [13] | example.net | [15] | / | [16] | [17]",
CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK},
{"https://user@example.net?hello# space ",
"https | user | [12] | [13] | example.net | [15] | / | hello | %20space%20",
CURLU_ALLOW_SPACE | CURLU_URLENCODE, 0, CURLUE_OK},
{"https://test%test", "", 0, 0, CURLUE_BAD_HOSTNAME},
{"https://example.com%252f%40@example.net",
"https | example.com%2f@ | [12] | [13] | example.net | [15] | / "
"| [16] | [17]",
0, CURLU_URLDECODE, CURLUE_OK },
{ "curl.se",
"[10] | [11] | [12] | [13] | curl.se | [15] | / | [16] | [17]",
CURLU_GUESS_SCHEME, CURLU_NO_GUESS_SCHEME, CURLUE_OK },
{ "https://curl.se:0/#",
"https | [11] | [12] | [13] | curl.se | 0 | / | [16] | ",
0, CURLU_GET_EMPTY, CURLUE_OK },
{ "https://curl.se/#",
"https | [11] | [12] | [13] | curl.se | [15] | / | [16] | ",
0, CURLU_GET_EMPTY, CURLUE_OK },
{ "https://curl.se/?#",
"https | [11] | [12] | [13] | curl.se | [15] | / | | ",
0, CURLU_GET_EMPTY, CURLUE_OK },
{ "https://curl.se/?",
"https | [11] | [12] | [13] | curl.se | [15] | / | | [17]",
0, CURLU_GET_EMPTY, CURLUE_OK },
{ "https://curl.se/?",
"https | [11] | [12] | [13] | curl.se | [15] | / | [16] | [17]",
0, 0, CURLUE_OK },
{ "https://curl.se/?#",
"https | [11] | [12] | [13] | curl.se | [15] | / | [16] | [17]",
0, 0, CURLUE_OK },
{ "https://curl.se/# ",
"https | [11] | [12] | [13] | curl.se | [15] | / | [16] | %20%20",
CURLU_URLENCODE | CURLU_ALLOW_SPACE, 0, CURLUE_OK },
{ "", "", 0, 0, CURLUE_MALFORMED_INPUT },
{ " ", "", 0, 0, CURLUE_MALFORMED_INPUT },
{ "1h://example.net", "", 0, 0, CURLUE_BAD_SCHEME },
{ "..://example.net", "", 0, 0, CURLUE_BAD_SCHEME },
{ "-ht://example.net", "", 0, 0, CURLUE_BAD_SCHEME },
{ "+ftp://example.net", "", 0, 0, CURLUE_BAD_SCHEME },
{ "hej.hej://example.net",
"hej.hej | [11] | [12] | [13] | example.net | [15] | / | [16] | [17]",
CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK },
{ "ht-tp://example.net",
"ht-tp | [11] | [12] | [13] | example.net | [15] | / | [16] | [17]",
CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK },
{ "ftp+more://example.net",
"ftp+more | [11] | [12] | [13] | example.net | [15] | / | [16] | [17]",
CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK },
{ "f1337://example.net",
"f1337 | [11] | [12] | [13] | example.net | [15] | / | [16] | [17]",
CURLU_NON_SUPPORT_SCHEME, 0, CURLUE_OK },
{ "https://user@example.net?hello# space ",
"https | user | [12] | [13] | example.net | [15] | / | hello | "
"%20space%20",
CURLU_ALLOW_SPACE | CURLU_URLENCODE, 0, CURLUE_OK },
{ "https://test%test", "", 0, 0, CURLUE_BAD_HOSTNAME },
{ "https://example.com%252f%40@example.net",
"https | example.com%2f@ | [12] | [13] | example.net | [15] | / "
"| [16] | [17]",
0, CURLU_URLDECODE, CURLUE_OK },
#ifdef USE_IDN
/*
https://sv.wikipedia.org/wiki/R%c3%a4ksm%c3%b6rg%c3%a5s
@ -274,22 +275,22 @@ static const struct testcase get_parts_list[] = {
https://codepoints.net/U+00F6 Latin Small Letter O with Diaeresis
https://codepoints.net/U+00E5 Latin Small Letter A with Ring Above
*/
{"https://r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se",
"https | [11] | [12] | [13] | xn--rksmrgs-5wao1o.se | "
"[15] | / | [16] | [17]", 0, CURLU_PUNYCODE, CURLUE_OK},
{"https://xn--rksmrgs-5wao1o.se",
"https | [11] | [12] | [13] | r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se | "
"[15] | / | [16] | [17]", 0, CURLU_PUNY2IDN, CURLUE_OK},
{"https://www.xn--rksmrgs-5wao1o.se",
"https | [11] | [12] | [13] | www.r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se | "
"[15] | / | [16] | [17]", 0, CURLU_PUNY2IDN, CURLUE_OK},
{"https://www.r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se",
"https | [11] | [12] | [13] | www.r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se | "
"[15] | / | [16] | [17]", 0, CURLU_PUNY2IDN, CURLUE_OK},
{ "https://r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se",
"https | [11] | [12] | [13] | xn--rksmrgs-5wao1o.se | "
"[15] | / | [16] | [17]", 0, CURLU_PUNYCODE, CURLUE_OK },
{ "https://xn--rksmrgs-5wao1o.se",
"https | [11] | [12] | [13] | r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se | "
"[15] | / | [16] | [17]", 0, CURLU_PUNY2IDN, CURLUE_OK },
{ "https://www.xn--rksmrgs-5wao1o.se",
"https | [11] | [12] | [13] | www.r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se | "
"[15] | / | [16] | [17]", 0, CURLU_PUNY2IDN, CURLUE_OK },
{ "https://www.r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se",
"https | [11] | [12] | [13] | www.r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se | "
"[15] | / | [16] | [17]", 0, CURLU_PUNY2IDN, CURLUE_OK },
#else
{"https://r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se",
"https | [11] | [12] | [13] | [30] | [15] | / | [16] | [17]",
0, CURLU_PUNYCODE, CURLUE_OK},
{ "https://r\xc3\xa4ksm\xc3\xb6rg\xc3\xa5s.se",
"https | [11] | [12] | [13] | [30] | [15] | / | [16] | [17]",
0, CURLU_PUNYCODE, CURLUE_OK },
#endif
/*
https://codepoints.net/U+2102 Double-Struck Capital C