projects
/
platform
/
upstream
/
curl.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "Imported Upstream version 7.44.0"
[platform/upstream/curl.git]
/
lib
/
netrc.c
diff --git
a/lib/netrc.c
b/lib/netrc.c
index
06f8ea1
..
7435d94
100644
(file)
--- a/
lib/netrc.c
+++ b/
lib/netrc.c
@@
-5,7
+5,7
@@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 201
5
, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 201
4
, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@
-31,11
+31,13
@@
#include "strequal.h"
#include "strtok.h"
#include "strequal.h"
#include "strtok.h"
+#include "curl_memory.h"
#include "rawstr.h"
#include "rawstr.h"
-#include "curl_printf.h"
-/* The last #include files should be: */
-#include "curl_memory.h"
+#define _MPRINTF_REPLACE /* use our functions only */
+#include <curl/mprintf.h>
+
+/* The last #include file should be: */
#include "memdebug.h"
/* Get user and password from .netrc when given a machine name */
#include "memdebug.h"
/* Get user and password from .netrc when given a machine name */
@@
-102,16
+104,16
@@
int Curl_parsenetrc(const char *host,
netrcfile = curl_maprintf("%s%s%s", home, DIR_CHAR, NETRC);
if(home_alloc)
netrcfile = curl_maprintf("%s%s%s", home, DIR_CHAR, NETRC);
if(home_alloc)
- free(home);
+
Curl_safe
free(home);
if(!netrcfile) {
return -1;
}
netrc_alloc = TRUE;
}
if(!netrcfile) {
return -1;
}
netrc_alloc = TRUE;
}
- file = fopen(netrcfile,
FOPEN_READTEXT
);
+ file = fopen(netrcfile,
"r"
);
if(netrc_alloc)
if(netrc_alloc)
- free(netrcfile);
+
Curl_safe
free(netrcfile);
if(file) {
char *tok;
char *tok_buf;
if(file) {
char *tok;
char *tok_buf;
@@
-137,10
+139,6
@@
int Curl_parsenetrc(const char *host,
'password'. */
state=HOSTFOUND;
}
'password'. */
state=HOSTFOUND;
}
- else if(Curl_raw_equal("default", tok)) {
- state=HOSTVALID;
- retcode=0; /* we did find our host */
- }
break;
case HOSTFOUND:
if(Curl_raw_equal(host, tok)) {
break;
case HOSTFOUND:
if(Curl_raw_equal(host, tok)) {