summaryrefslogtreecommitdiff
path: root/lib/netrc.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2016-09-30 18:54:02 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-10-31 08:46:35 +0100
commit811a693b803a8715e15ba56fb161d9e6b3b6b016 (patch)
tree47f61478d7d860eadba5396d88a444e906f6cfb9 /lib/netrc.c
parent502acba2af821391b85a2cd4ac7b91ad8e9d4180 (diff)
downloadcurl-811a693b803a8715e15ba56fb161d9e6b3b6b016.tar.gz
strcasecompare: all case insensitive string compares ignore locale now
We had some confusions on when each function was used. We should not act differently on different locales anyway.
Diffstat (limited to 'lib/netrc.c')
-rw-r--r--lib/netrc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/netrc.c b/lib/netrc.c
index 558440a11..996711d11 100644
--- a/lib/netrc.c
+++ b/lib/netrc.c
@@ -29,7 +29,7 @@
#include <curl/curl.h>
#include "netrc.h"
#include "strtok.h"
-#include "rawstr.h"
+#include "strcase.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
@@ -128,20 +128,20 @@ int Curl_parsenetrc(const char *host,
switch(state) {
case NOTHING:
- if(Curl_raw_equal("machine", tok)) {
+ if(strcasecompare("machine", tok)) {
/* the next tok is the machine name, this is in itself the
delimiter that starts the stuff entered for this machine,
after this we need to search for 'login' and
'password'. */
state=HOSTFOUND;
}
- else if(Curl_raw_equal("default", tok)) {
+ else if(strcasecompare("default", tok)) {
state=HOSTVALID;
retcode=0; /* we did find our host */
}
break;
case HOSTFOUND:
- if(Curl_raw_equal(host, tok)) {
+ if(strcasecompare(host, tok)) {
/* and yes, this is our host! */
state=HOSTVALID;
retcode=0; /* we did find our host */
@@ -154,7 +154,7 @@ int Curl_parsenetrc(const char *host,
/* we are now parsing sub-keywords concerning "our" host */
if(state_login) {
if(specific_login) {
- state_our_login = Curl_raw_equal(*loginp, tok);
+ state_our_login = strcasecompare(*loginp, tok);
}
else {
free(*loginp);
@@ -177,11 +177,11 @@ int Curl_parsenetrc(const char *host,
}
state_password=0;
}
- else if(Curl_raw_equal("login", tok))
+ else if(strcasecompare("login", tok))
state_login=1;
- else if(Curl_raw_equal("password", tok))
+ else if(strcasecompare("password", tok))
state_password=1;
- else if(Curl_raw_equal("machine", tok)) {
+ else if(strcasecompare("machine", tok)) {
/* ok, there's machine here go => */
state = HOSTFOUND;
state_our_login = FALSE;