summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/netrc.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2018-12-14 03:33:12 +0300
committerdartraiden <wowemuh@gmail.com>2018-12-14 03:33:29 +0300
commitfff280ec7c91e7bbba1f8dd389468717f08e9106 (patch)
treeae20777655e2814dd5ab9be0e456a472065e62ce /libs/libcurl/src/netrc.c
parent887544273011d56a796e9507199ea8d6484d31c6 (diff)
libcurl: update to 7.63
Diffstat (limited to 'libs/libcurl/src/netrc.c')
-rw-r--r--libs/libcurl/src/netrc.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/libcurl/src/netrc.c b/libs/libcurl/src/netrc.c
index 1724b35b0b..aba355b760 100644
--- a/libs/libcurl/src/netrc.c
+++ b/libs/libcurl/src/netrc.c
@@ -53,6 +53,8 @@ enum host_lookup_state {
int Curl_parsenetrc(const char *host,
char **loginp,
char **passwordp,
+ bool *login_changed,
+ bool *password_changed,
char *netrcfile)
{
FILE *file;
@@ -164,7 +166,7 @@ int Curl_parsenetrc(const char *host,
if(specific_login) {
state_our_login = strcasecompare(login, tok);
}
- else {
+ else if(!login || strcmp(login, tok)) {
if(login_alloc) {
free(login);
login_alloc = FALSE;
@@ -179,7 +181,8 @@ int Curl_parsenetrc(const char *host,
state_login = 0;
}
else if(state_password) {
- if(state_our_login || !specific_login) {
+ if((state_our_login || !specific_login)
+ && (!password || strcmp(password, tok))) {
if(password_alloc) {
free(password);
password_alloc = FALSE;
@@ -211,15 +214,19 @@ int Curl_parsenetrc(const char *host,
out:
if(!retcode) {
+ *login_changed = FALSE;
+ *password_changed = FALSE;
if(login_alloc) {
if(*loginp)
free(*loginp);
*loginp = login;
+ *login_changed = TRUE;
}
if(password_alloc) {
if(*passwordp)
free(*passwordp);
*passwordp = password;
+ *password_changed = TRUE;
}
}
else {