Commit 709df665 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Treat CR as whitespace.

This allows using telnet on the local interface.
parent 7645f673
......@@ -60,7 +60,7 @@ typedef int (*gnc_t)(void*);
static int
skip_whitespace(int c, gnc_t gnc, void *closure)
{
while(c == ' ' || c == '\t')
while(c == ' ' || c == '\t' || c == '\r')
c = gnc(closure);
return c;
}
......@@ -88,7 +88,7 @@ getword(int c, char **token_r, gnc_t gnc, void *closure)
if(i >= 255) return -2;
buf[i++] = c;
c = gnc(closure);
} while(c != ' ' && c != '\t' && c != '\n' && c != '#' && c >= 0);
} while(c != ' ' && c != '\t' && c != '\r' && c != '\n' && c != '#' && c >= 0);
buf[i] = '\0';
*token_r = strdup(buf);
return c;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment