From: Viktor Szakats Date: Fri, 14 Nov 2025 15:58:05 +0000 (+0100) Subject: badwords: fix two exceptions and drop them X-Git-Tag: rc-8_18_0-1~291 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af4c789e0084f5076fd1f370363b054a842e79f5;p=thirdparty%2Fcurl.git badwords: fix two exceptions and drop them Also: - extend `dir` rule to exclude C assignments. Closes #19532 --- diff --git a/.github/scripts/badwords.txt b/.github/scripts/badwords.txt index 7f6bca32b6..705c54fbac 100644 --- a/.github/scripts/badwords.txt +++ b/.github/scripts/badwords.txt @@ -45,7 +45,7 @@ there's:there is ^(And|So|But) = Rewrite it somehow? \. But: Rewrite it somehow? \. So : Rewrite without "so" ? - dir :directory + dir [^=]:directory sub-director:subdirector you'd:you would you'll:you will diff --git a/.github/workflows/checksrc.yml b/.github/workflows/checksrc.yml index 94407ff677..663811ef93 100644 --- a/.github/workflows/checksrc.yml +++ b/.github/workflows/checksrc.yml @@ -176,4 +176,4 @@ jobs: # we allow some extra in source code - name: 'badwords' - run: grep -Ev '(\\bwill| url | dir )' .github/scripts/badwords.txt | .github/scripts/badwords.pl src lib include + run: grep -Ev '(\\bwill)' .github/scripts/badwords.txt | .github/scripts/badwords.pl src lib include diff --git a/lib/ftp.h b/lib/ftp.h index 8d5f9c2031..f4ddb1a37c 100644 --- a/lib/ftp.h +++ b/lib/ftp.h @@ -61,11 +61,11 @@ enum { FTP_STOR_PREQUOTE, FTP_LIST_PREQUOTE, FTP_POSTQUOTE, - FTP_CWD, /* change dir */ - FTP_MKD, /* if the dir did not exist */ + FTP_CWD, /* change directory */ + FTP_MKD, /* if the directory did not exist */ FTP_MDTM, /* to figure out the datestamp */ FTP_TYPE, /* to set type when doing a head-like request */ - FTP_LIST_TYPE, /* set type when about to do a dir list */ + FTP_LIST_TYPE, /* set type when about to do a directory list */ FTP_RETR_LIST_TYPE, FTP_RETR_TYPE, /* set type when about to RETR a file */ FTP_STOR_TYPE, /* set type when about to STOR a file */ diff --git a/lib/http_aws_sigv4.c b/lib/http_aws_sigv4.c index b5601f45a2..d3d4760be7 100644 --- a/lib/http_aws_sigv4.c +++ b/lib/http_aws_sigv4.c @@ -1141,10 +1141,10 @@ static CURLcode http_aws_decode_encode(const char *in, size_t in_len, static bool should_urlencode(struct Curl_str *service_name) { /* - * These services require unmodified (not additionally url encoded) URL + * These services require unmodified (not additionally URL-encoded) URL * paths. * should_urlencode == true is equivalent to should_urlencode_uri_path - * from the AWS SDK. Urls are already normalized by the curl url parser + * from the AWS SDK. Urls are already normalized by the curl URL parser */ if(curlx_str_cmp(service_name, "s3") || diff --git a/lib/urldata.h b/lib/urldata.h index f92bfcb3b2..4b112e7072 100644 --- a/lib/urldata.h +++ b/lib/urldata.h @@ -238,7 +238,7 @@ struct ssl_backend_data; struct Curl_ssl_scache_entry; struct ssl_primary_config { - char *CApath; /* certificate dir (does not work on Windows) */ + char *CApath; /* certificate directory (does not work on Windows) */ char *CAfile; /* certificate to verify peer against */ char *issuercert; /* optional issuer certificate filename */ char *clientcert; diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 07036f900a..74a1da5a3e 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -1677,7 +1677,7 @@ static int myssh_in_SFTP_QUOTE(struct Curl_easy *data, else if(!strncmp(cmd, "mkdir ", 6)) { if(*cp) return return_quote_error(data, sshc); - /* create dir */ + /* create directory */ myssh_to(data, sshc, SSH_SFTP_QUOTE_MKDIR); return SSH_NO_ERROR; } @@ -1703,7 +1703,7 @@ static int myssh_in_SFTP_QUOTE(struct Curl_easy *data, return SSH_NO_ERROR; } else if(!strncmp(cmd, "rmdir ", 6)) { - /* delete dir */ + /* delete directory */ if(*cp) return return_quote_error(data, sshc); myssh_to(data, sshc, SSH_SFTP_QUOTE_RMDIR); @@ -2157,9 +2157,9 @@ static CURLcode myssh_statemach_act(struct Curl_easy *data, ++sshc->slash_pos; if(rc < 0) { /* - * Abort if failure was not that the dir already exists or the - * permission was denied (creation might succeed further down the - * path) - retry on unspecific FAILURE also + * Abort if failure was not that the directory already exists or + * the permission was denied (creation might succeed further down + * the path) - retry on unspecific FAILURE also */ err = sftp_get_error(sshc->sftp_session); if((err != SSH_FX_FILE_ALREADY_EXISTS) && @@ -2744,7 +2744,7 @@ static CURLcode myssh_do_it(struct Curl_easy *data, bool *done) data->req.size = -1; /* make sure this is unknown at this point */ sshc->actualcode = CURLE_OK; /* reset error code */ - sshc->secondCreateDirs = 0; /* reset the create dir attempt state + sshc->secondCreateDirs = 0; /* reset the create directory attempt state variable */ Curl_pgrsSetUploadCounter(data, 0); diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index b414dfcf2d..49044669fc 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -957,7 +957,7 @@ static CURLcode sftp_quote(struct Curl_easy *data, else if(!strncmp(cmd, "mkdir ", 6)) { if(*cp) return_quote_error(data, sshc); - /* create dir */ + /* create directory */ myssh_state(data, sshc, SSH_SFTP_QUOTE_MKDIR); return result; } @@ -980,7 +980,7 @@ static CURLcode sftp_quote(struct Curl_easy *data, else if(!strncmp(cmd, "rmdir ", 6)) { if(*cp) return_quote_error(data, sshc); - /* delete dir */ + /* delete directory */ myssh_state(data, sshc, SSH_SFTP_QUOTE_RMDIR); return result; } @@ -2275,9 +2275,9 @@ static CURLcode ssh_state_sftp_create_dirs_mkdir(struct Curl_easy *data, ++sshc->slash_pos; if(rc < 0) { /* - * Abort if failure was not that the dir already exists or the - * permission was denied (creation might succeed further down the - * path) - retry on unspecific FAILURE also + * Abort if failure was not that the directory already exists or + * the permission was denied (creation might succeed further down + * the path) - retry on unspecific FAILURE also */ unsigned long sftperr = libssh2_sftp_last_error(sshc->sftp_session); if((sftperr != LIBSSH2_FX_FILE_ALREADY_EXISTS) && @@ -3528,7 +3528,7 @@ static CURLcode ssh_do(struct Curl_easy *data, bool *done) return CURLE_FAILED_INIT; data->req.size = -1; /* make sure this is unknown at this point */ - sshc->secondCreateDirs = 0; /* reset the create dir attempt state + sshc->secondCreateDirs = 0; /* reset the create directory attempt state variable */ Curl_pgrsSetUploadCounter(data, 0); diff --git a/lib/vssh/ssh.h b/lib/vssh/ssh.h index 9d03b52f40..5317351478 100644 --- a/lib/vssh/ssh.h +++ b/lib/vssh/ssh.h @@ -149,8 +149,8 @@ struct ssh_conn { char *quote_path1; /* two generic pointers for the QUOTE stuff */ char *quote_path2; - char *homedir; /* when doing SFTP we figure out home dir in the - connect phase */ + char *homedir; /* when doing SFTP we figure out home directory + in the connect phase */ /* end of READDIR stuff */ int secondCreateDirs; /* counter use by the code to see if the diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h index 630f23fd96..cac22483b7 100644 --- a/src/tool_cfgable.h +++ b/src/tool_cfgable.h @@ -248,7 +248,7 @@ struct OperationConfig { BIT(autoreferer); /* automatically set referer */ BIT(show_headers); /* show headers to data output */ BIT(no_body); /* do not get the body */ - BIT(dirlistonly); /* only get the FTP dir list */ + BIT(dirlistonly); /* only get the FTP directory list */ BIT(unrestricted_auth); /* Continue to send authentication (user+password) when following redirects, even when hostname changed */ diff --git a/src/tool_ipfs.c b/src/tool_ipfs.c index 89d12fc1c6..0214a2004f 100644 --- a/src/tool_ipfs.c +++ b/src/tool_ipfs.c @@ -176,7 +176,7 @@ CURLcode ipfs_url_rewrite(CURLU *uh, const char *protocol, char **url, goto clean; /* inputpath might be NULL or a valid pointer now */ - /* set gateway parts in input url */ + /* set gateway parts in input URL */ if(curl_url_set(uh, CURLUPART_SCHEME, gwscheme, CURLU_URLENCODE) || curl_url_set(uh, CURLUPART_HOST, gwhost, CURLU_URLENCODE) || curl_url_set(uh, CURLUPART_PORT, gwport, CURLU_URLENCODE)) diff --git a/src/tool_operate.c b/src/tool_operate.c index 9aee520f06..1317e73551 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -2123,7 +2123,7 @@ static CURLcode transfer_per_config(struct OperationConfig *config, CURLcode result; *added = FALSE; - /* Check we have a url */ + /* Check we have a URL */ if(!config->url_list || !config->url_list->url) { helpf("(%d) no URL specified", CURLE_FAILED_INIT); result = CURLE_FAILED_INIT; diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c index a832390540..d25fccf46c 100644 --- a/src/tool_operhlp.c +++ b/src/tool_operhlp.c @@ -80,7 +80,7 @@ CURLcode urlerr_cvt(CURLUcode ucode) /* * Adds the filename to the URL if it does not already have one. - * url will be freed before return if the returned pointer is different + * URL will be freed before return if the returned pointer is different */ CURLcode add_file_name_to_url(CURL *curl, char **inurlp, const char *filename) { diff --git a/src/tool_writeout.h b/src/tool_writeout.h index eebfde03b2..70b3cd148b 100644 --- a/src/tool_writeout.h +++ b/src/tool_writeout.h @@ -56,7 +56,7 @@ typedef enum { VAR_INPUT_URLQUERY, VAR_INPUT_URLFRAGMENT, VAR_INPUT_URLZONEID, - /* the same ones again for url *effective* */ + /* the same ones again for URL *effective* */ VAR_INPUT_URLESCHEME, /* keep this the first URLE* variable */ VAR_INPUT_URLEUSER, VAR_INPUT_URLEPASSWORD,