]> diplodocus.org Git - nmh/commitdiff
Fix netrc's token() bug of first character being backslash.
authorRalph Corderoy <ralph@inputplus.co.uk>
Sat, 22 Oct 2016 17:01:16 +0000 (18:01 +0100)
committerRalph Corderoy <ralph@inputplus.co.uk>
Sat, 22 Oct 2016 17:01:16 +0000 (18:01 +0100)
sbr/ruserpass.c

index fb786d0..5b65038 100644 (file)
@@ -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 == '\\')