summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/netrc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libcurl/src/netrc.c')
-rw-r--r--libs/libcurl/src/netrc.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/libs/libcurl/src/netrc.c b/libs/libcurl/src/netrc.c
index 1586f76fd1..7ed1ea204a 100644
--- a/libs/libcurl/src/netrc.c
+++ b/libs/libcurl/src/netrc.c
@@ -26,15 +26,20 @@
#ifndef CURL_DISABLE_NETRC
#ifdef HAVE_PWD_H
+#ifdef __AMIGA__
#undef __NO_NET_API /* required for AmigaOS to declare getpwuid() */
+#endif
#include <pwd.h>
+#ifdef __AMIGA__
#define __NO_NET_API
#endif
+#endif
#include <curl/curl.h>
#include "netrc.h"
#include "strcase.h"
#include "curl_get_line.h"
+#include "strparse.h"
/* The last 3 #include files should be in this order */
#include "curl_printf.h"
@@ -81,8 +86,7 @@ static NETRCcode file2memory(const char *filename, struct dynbuf *filebuf)
CURLcode result;
const char *line = Curl_dyn_ptr(&linebuf);
/* skip comments on load */
- while(ISBLANK(*line))
- line++;
+ Curl_str_passblanks(&line);
if(*line == '#')
continue;
result = Curl_dyn_add(filebuf, line);
@@ -134,13 +138,12 @@ static NETRCcode parsenetrc(struct store_netrc *store,
netrcbuffer = Curl_dyn_ptr(filebuf);
while(!done) {
- char *tok = netrcbuffer;
+ const char *tok = netrcbuffer;
while(tok && !done) {
- char *tok_end;
+ const char *tok_end;
bool quoted;
Curl_dyn_reset(&token);
- while(ISBLANK(*tok))
- tok++;
+ Curl_str_passblanks(&tok);
/* tok is first non-space letter */
if(state == MACDEF) {
if((*tok == '\n') || (*tok == '\r'))
@@ -158,7 +161,7 @@ static NETRCcode parsenetrc(struct store_netrc *store,
if(!quoted) {
size_t len = 0;
CURLcode result;
- while(!ISSPACE(*tok_end)) {
+ while(*tok_end > ' ') {
tok_end++;
len++;
}