mirror of
https://github.com/curl/curl.git
synced 2026-08-01 14:58:54 +03:00
strcasecompare: is the new name for strequal()
... to make it less likely that we forget that the function actually does case insentive compares. Also replaced several invokes of the function with a plain strcmp when case sensitivity is not an issue (like comparing with "-").
This commit is contained in:
parent
1833a45dde
commit
502acba2af
36 changed files with 98 additions and 111 deletions
|
|
@ -416,7 +416,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
}
|
||||
|
||||
for(j = 0; j < sizeof(aliases)/sizeof(aliases[0]); j++) {
|
||||
if(curlx_strnequal(aliases[j].lname, word, fnam)) {
|
||||
if(curlx_strncasecompare(aliases[j].lname, word, fnam)) {
|
||||
longopt = TRUE;
|
||||
numhits++;
|
||||
if(curlx_raw_equal(aliases[j].lname, word)) {
|
||||
|
|
@ -1109,7 +1109,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
break;
|
||||
case 'C':
|
||||
/* This makes us continue an ftp transfer at given position */
|
||||
if(!curlx_strequal(nextarg, "-")) {
|
||||
if(strcmp(nextarg, "-")) {
|
||||
err = str2offset(&config->resume_from, nextarg);
|
||||
if(err)
|
||||
return err;
|
||||
|
|
@ -1153,7 +1153,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
}
|
||||
if('@' == is_file) {
|
||||
/* a '@' letter, it means that a file name or - (stdin) follows */
|
||||
if(curlx_strequal("-", p)) {
|
||||
if(!strcmp("-", p)) {
|
||||
file = stdin;
|
||||
set_binmode(stdin);
|
||||
}
|
||||
|
|
@ -1218,7 +1218,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
or - (stdin) follows */
|
||||
nextarg++; /* pass the @ */
|
||||
|
||||
if(curlx_strequal("-", nextarg)) {
|
||||
if(!strcmp("-", nextarg)) {
|
||||
file = stdin;
|
||||
if(subletter == 'b') /* forced data-binary */
|
||||
set_binmode(stdin);
|
||||
|
|
@ -1377,7 +1377,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
case 'm': /* TLS authentication type */
|
||||
if(curlinfo->features & CURL_VERSION_TLSAUTH_SRP) {
|
||||
GetStr(&config->tls_authtype, nextarg);
|
||||
if(!strequal(config->tls_authtype, "SRP"))
|
||||
if(!strcasecompare(config->tls_authtype, "SRP"))
|
||||
return PARAM_LIBCURL_DOESNT_SUPPORT; /* only support TLS-SRP */
|
||||
}
|
||||
else
|
||||
|
|
@ -1770,7 +1770,7 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
|
|||
FILE *file;
|
||||
const char *fname;
|
||||
nextarg++; /* pass the @ */
|
||||
if(curlx_strequal("-", nextarg)) {
|
||||
if(!strcmp("-", nextarg)) {
|
||||
fname = "<stdin>";
|
||||
file = stdin;
|
||||
}
|
||||
|
|
@ -1880,7 +1880,7 @@ ParameterError parse_args(struct GlobalConfig *config, int argc,
|
|||
bool passarg;
|
||||
char *flag = argv[i];
|
||||
|
||||
if(curlx_strequal("--", argv[i]))
|
||||
if(!strcmp("--", argv[i]))
|
||||
/* This indicates the end of the flags and thus enables the
|
||||
following (URL) argument to start with -. */
|
||||
stillflags = FALSE;
|
||||
|
|
@ -1936,7 +1936,7 @@ ParameterError parse_args(struct GlobalConfig *config, int argc,
|
|||
result != PARAM_ENGINES_REQUESTED) {
|
||||
const char *reason = param2text(result);
|
||||
|
||||
if(orig_opt && !curlx_strequal(":", orig_opt))
|
||||
if(orig_opt && strcmp(":", orig_opt))
|
||||
helpf(config->errors, "option %s: %s\n", orig_opt, reason);
|
||||
else
|
||||
helpf(config->errors, "%s\n", reason);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue