diff --git a/qio.c b/qio.c index f17d9ee..ea1832e 100644 --- a/qio.c +++ b/qio.c @@ -62,12 +62,13 @@ qprintf(char *fmt, ...) if (ch == '\\') { ch = *fmt++; switch (ch) { + case 'a': ch = '\a'; break; + case 'b': ch = '\b'; break; + case 'f': ch = '\f'; break; case 'n': ch = '\n'; break; case 'r': ch = '\r'; break; case 't': ch = '\t'; break; - case 'f': ch = '\f'; break; case 'v': ch = '\v'; break; - case 'b': ch = '\b'; break; case 0: va_end(ap); return; diff --git a/str.c b/str.c index 2f5ac23..45f7e66 100644 --- a/str.c +++ b/str.c @@ -1380,17 +1380,17 @@ printechar(char *c) math_chr('\\'); ech = 0; switch (ch) { + case '\a': ech = 'a'; break; + case '\b': ech = 'b'; break; + case '\f': ech = 'f'; break; case '\n': ech = 'n'; break; case '\r': ech = 'r'; break; case '\t': ech = 't'; break; - case '\b': ech = 'b'; break; - case '\f': ech = 'f'; break; case '\v': ech = 'v'; break; case '\\': ech = '\\'; break; case '\"': ech = '\"'; break; case '\'': ech = '\''; break; case 0: ech = '0'; break; - case 7: ech = 'a'; break; case 27: ech = 'e'; break; } if (ech == '0') { @@ -1438,8 +1438,17 @@ fitstring(char *str, long len, long width) continue; n++; switch (ch) { - case '\n': case '\r': case '\t': case '\b': case '\f': - case '\v': case '\\': case '\"': case 7: case 27: + case '\a': + case '\b': + case '\f': + case '\n': + case '\r': + case '\t': + case '\v': + case '\\': + case '\"': + case '\'': + case 27: continue; } if (ch >= 64 || (nch >= '0' && nch <= '7')) { diff --git a/token.c b/token.c index 27468a9..3f0032f 100644 --- a/token.c +++ b/token.c @@ -183,10 +183,12 @@ gettoken(void) } switch (ch) { case ' ': - case '\t': - case '\r': - case '\v': + case '\a': + case '\b': case '\f': + case '\r': + case '\t': + case '\v': case '\0': break; case '\n':