aboutsummaryrefslogtreecommitdiffstats
path: root/netrc.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-02-15 04:32:43 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-02-15 04:32:43 +0000
commit3e3f80d2449128884b70929feee97fa3c240421a (patch)
tree69292d7cb6834e85995bab60e1d6db131ab97b95 /netrc.c
parent113f3d0007e99360a0e0cf72cd5e9bccab2216bc (diff)
downloadfetchmail-3e3f80d2449128884b70929feee97fa3c240421a.tar.gz
fetchmail-3e3f80d2449128884b70929feee97fa3c240421a.tar.bz2
fetchmail-3e3f80d2449128884b70929feee97fa3c240421a.zip
netrc improvement.
svn path=/trunk/; revision=1624
Diffstat (limited to 'netrc.c')
-rw-r--r--netrc.c37
1 files changed, 33 insertions, 4 deletions
diff --git a/netrc.c b/netrc.c
index 635228a7..44339590 100644
--- a/netrc.c
+++ b/netrc.c
@@ -133,6 +133,9 @@ parse_netrc (file)
/* If we are defining macros, then skip parsing the line. */
while (*p && last_token != tok_macdef)
{
+ char quote_char = 0;
+ char *pp;
+
/* Skip any whitespace. */
while (*p && isspace (*p))
p++;
@@ -141,15 +144,41 @@ parse_netrc (file)
if (*p == '#')
break;
- tok = p;
+ tok = pp = p;
/* Find the end of the token. */
- while (*p && !isspace (*p))
- p ++;
-
+ while (*p && (quote_char || !isspace (*p)))
+ {
+ if (quote_char)
+ {
+ if (quote_char == *p)
+ {
+ quote_char = 0;
+ p ++;
+ }
+ else
+ {
+ *pp = *p;
+ p ++;
+ pp ++;
+ }
+ }
+ else
+ {
+ if (*p == '"' || *p == '\'')
+ quote_char = *p;
+ else
+ {
+ *pp = *p;
+ pp ++;
+ }
+ p ++;
+ }
+ }
/* Null-terminate the token, if it isn't already. */
if (*p)
*p ++ = '\0';
+ *pp = 0;
switch (last_token)
{