From: Ralph Corderoy Date: Sat, 22 Oct 2016 17:01:16 +0000 (+0100) Subject: Fix netrc's token() bug of first character being backslash. X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/6911ccf8fcd1ad179801d517f48817ea8c22b4a3?ds=inline Fix netrc's token() bug of first character being backslash. --- 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 == '\\')