mirror of
https://github.com/curl/curl.git
synced 2026-07-25 05:57:24 +03:00
tidy-up: miscellaneous
- vms/curlmsg_vms.h: delete unused/commented code. - vtls/schannel_verify: sort includes. - typecheck-gcc.h: fix indent and alignment. - lib/config-win32.h: drop idle `#undef`. - spacecheck: check for stray empty lines before after curly braces. - make literals more readable: 1048576 -> 1024 * 1024 - scope variables. - use ISO date in a comment. - drop redundant parentheses. - drop empty comments. - unfold lines. - duplicate/stray spaces in comments. - fix indent, whitespace, minor typos. Closes #20690
This commit is contained in:
parent
ac46392f44
commit
af78b199b2
89 changed files with 424 additions and 448 deletions
|
|
@ -185,12 +185,12 @@ static SANITIZEcode msdosify(char ** const sanitized, const char *file_name,
|
|||
and a filename cannot have more than a single dot. We leave the
|
||||
first non-leading dot alone, unless it comes too close to the
|
||||
beginning of the name: we want sh.lex.c to become sh_lex.c, not
|
||||
sh.lex-c. */
|
||||
sh.lex-c. */
|
||||
else if(*s == '.') {
|
||||
if((flags & SANITIZE_ALLOW_PATH) && idx == 0 &&
|
||||
(s[1] == '/' || s[1] == '\\' ||
|
||||
(s[1] == '.' && (s[2] == '/' || s[2] == '\\')))) {
|
||||
/* Copy "./" and "../" verbatim. */
|
||||
/* Copy "./" and "../" verbatim. */
|
||||
*d++ = *s++;
|
||||
if(d == dlimit)
|
||||
break;
|
||||
|
|
@ -225,7 +225,7 @@ static SANITIZEcode msdosify(char ** const sanitized, const char *file_name,
|
|||
*d = 'x';
|
||||
}
|
||||
else {
|
||||
/* libg++ etc. */
|
||||
/* libg++ etc. */
|
||||
if(dlimit - d < 4) {
|
||||
*d++ = 'x';
|
||||
if(d == dlimit)
|
||||
|
|
@ -326,7 +326,7 @@ static SANITIZEcode rename_if_reserved_dos(char ** const sanitized,
|
|||
Examples: CON => _CON, CON.EXT => CON_EXT, CON:ADS => CON_ADS
|
||||
https://web.archive.org/web/20160314141551/support.microsoft.com/en-us/kb/74496
|
||||
https://learn.microsoft.com/windows/win32/fileio/naming-a-file
|
||||
*/
|
||||
*/
|
||||
for(p = buffer; p; p = (p == buffer && buffer != base ? base : NULL)) {
|
||||
size_t p_len;
|
||||
int x = (curl_strnequal(p, "CON", 3) ||
|
||||
|
|
|
|||
|
|
@ -456,7 +456,7 @@ UNITTEST ParameterError parse_cert_parameter(const char *cert_parameter,
|
|||
#ifdef _WIN32
|
||||
if((param_place == &cert_parameter[1]) &&
|
||||
(cert_parameter[2] == '\\' || cert_parameter[2] == '/') &&
|
||||
(ISALPHA(cert_parameter[0]))) {
|
||||
ISALPHA(cert_parameter[0])) {
|
||||
/* colon in the second column, followed by a backslash, and the
|
||||
first character is an alphabetic letter:
|
||||
|
||||
|
|
@ -559,7 +559,7 @@ static const struct sizeunit *getunit(char unit)
|
|||
We support P, T, G, M and K (case insensitive) suffixes.
|
||||
|
||||
Unit test 1623
|
||||
*/
|
||||
*/
|
||||
UNITTEST ParameterError GetSizeParameter(const char *arg, curl_off_t *out)
|
||||
{
|
||||
const char *unit = arg;
|
||||
|
|
@ -1016,7 +1016,7 @@ static ParameterError set_rate(const char *nextarg)
|
|||
/m == per minute
|
||||
/h == per hour (default)
|
||||
/d == per day (24 hours)
|
||||
*/
|
||||
*/
|
||||
ParameterError err = PARAM_OK;
|
||||
const char *p = nextarg;
|
||||
curl_off_t denominator;
|
||||
|
|
@ -1256,7 +1256,7 @@ static ParameterError parse_ech(struct OperationConfig *config,
|
|||
warnf("Could not read file \"%s\" "
|
||||
"specified for \"--ech ecl:\" option",
|
||||
nextarg);
|
||||
return PARAM_BAD_USE; /* */
|
||||
return PARAM_BAD_USE;
|
||||
}
|
||||
err = file2string(&tmpcfg, file);
|
||||
if(file != stdin)
|
||||
|
|
@ -2791,7 +2791,7 @@ static ParameterError opt_string(struct OperationConfig *config,
|
|||
/* use <eth0> or <192.168.10.10> style addresses. Anything except
|
||||
this will make us try to get the "default" address.
|
||||
NOTE: this is a changed behavior since the released 4.1!
|
||||
*/
|
||||
*/
|
||||
err = getstr(&config->ftpport, nextarg, DENY_BLANK);
|
||||
break;
|
||||
case C_FTP_SSL_CCC_MODE: /* --ftp-ssl-ccc-mode */
|
||||
|
|
@ -2809,11 +2809,11 @@ static ParameterError opt_string(struct OperationConfig *config,
|
|||
err = add2list(&config->telnet_options, nextarg);
|
||||
break;
|
||||
case C_USER: /* --user */
|
||||
/* user:password */
|
||||
/* user:password */
|
||||
err = getstr(&config->userpwd, nextarg, ALLOW_BLANK);
|
||||
break;
|
||||
case C_PROXY_USER: /* --proxy-user */
|
||||
/* Proxy user:password */
|
||||
/* Proxy user:password */
|
||||
err = getstr(&config->proxyuserpwd, nextarg, ALLOW_BLANK);
|
||||
break;
|
||||
case C_WRITE_OUT: /* --write-out */
|
||||
|
|
|
|||
|
|
@ -209,7 +209,8 @@ ParameterError parseconfig(const char *filename, int max_recursive,
|
|||
}
|
||||
|
||||
#ifdef DEBUG_CONFIG
|
||||
curl_mfprintf(tool_stderr, "PARAM: \"%s\"\n",(param ? param : "(null)"));
|
||||
curl_mfprintf(tool_stderr, "PARAM: \"%s\"\n",
|
||||
(param ? param : "(null)"));
|
||||
#endif
|
||||
res = getparameter(option, param, &usedarg, config, max_recursive);
|
||||
config = global->last;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ static CURLcode glob_set(struct URLGlob *glob, const char **patternp,
|
|||
{
|
||||
/* processes a set expression with the point behind the opening '{'
|
||||
','-separated elements are collected until the next closing '}'
|
||||
*/
|
||||
*/
|
||||
struct URLPattern *pat;
|
||||
bool done = FALSE;
|
||||
const char *pattern = *patternp;
|
||||
|
|
@ -217,7 +217,7 @@ static CURLcode glob_range(struct URLGlob *glob, const char **patternp,
|
|||
- num range: e.g. "0-9]", "17-2000]"
|
||||
- num range with leading zeros: e.g. "001-999]"
|
||||
expression is checked for well-formedness and collected until the next ']'
|
||||
*/
|
||||
*/
|
||||
struct URLPattern *pat;
|
||||
const char *pattern = *patternp;
|
||||
const char *c;
|
||||
|
|
@ -460,7 +460,7 @@ static CURLcode glob_parse(struct URLGlob *glob, const char *pattern,
|
|||
curlx_dyn_reset(&glob->buf);
|
||||
}
|
||||
else {
|
||||
if(!*pattern) /* done */
|
||||
if(!*pattern) /* done */
|
||||
break;
|
||||
else if(*pattern == '{') {
|
||||
/* process set pattern */
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ void vms_special_exit(int code, int vms_show)
|
|||
#endif
|
||||
|
||||
if(code > CURL_LAST) { /* If CURL_LAST exceeded then */
|
||||
vms_code = CURL_LAST; /* curlmsg.h is out of sync. */
|
||||
vms_code = CURL_LAST; /* curlmsg.h is out of sync. */
|
||||
}
|
||||
else {
|
||||
vms_code = vms_cond[code] | vms_show;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue