From 6911ccf8fcd1ad179801d517f48817ea8c22b4a3 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Sat, 22 Oct 2016 18:01:16 +0100 Subject: [PATCH] Fix netrc's token() bug of first character being backslash. --- sbr/ruserpass.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sbr/ruserpass.c b/sbr/ruserpass.c index fb786d0a..5b650389 100644 --- a/sbr/ruserpass.c +++ b/sbr/ruserpass.c @@ -199,7 +199,9 @@ token(char *tokval) * separators. */ stop = "\""; else - *cp++ = c; /* BUG: If a backslash then it doesn't escape. */ + /* Might be backslash. Get it again later. It's handled then. */ + if (ungetc(c, cfile) == EOF) + return TOK_EOF; while ((c = getc(cfile)) != EOF && c && !strchr(stop, c)) { if (c == '\\') -- 2.56.0