diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2018-01-24 16:28:26 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2018-01-24 16:28:26 +0000 |
commit | 609e173c54ea116f71aec20b7b92474663239b5e (patch) | |
tree | 507c163182c5b3f732e6f7c27b0a55da24e79e1d /usr.bin/awk | |
parent | adb8889d26832ec8acf24267185768185bf56e2a (diff) |
POSIX requires that awk support \v and \a escapes. I used '\007'
for BEL since that is what lex.c uses, though we could safely use
'\a' there instead. OK martijn@
Diffstat (limited to 'usr.bin/awk')
-rw-r--r-- | usr.bin/awk/b.c | 6 | ||||
-rw-r--r-- | usr.bin/awk/tran.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/awk/b.c b/usr.bin/awk/b.c index cfc0a57339e..5091823bb01 100644 --- a/usr.bin/awk/b.c +++ b/usr.bin/awk/b.c @@ -1,4 +1,4 @@ -/* $OpenBSD: b.c,v 1.19 2017/10/09 14:51:31 deraadt Exp $ */ +/* $OpenBSD: b.c,v 1.20 2018/01/24 16:28:25 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -260,6 +260,8 @@ int quoted(uschar **pp) /* pick up next thing after a \\ */ if ((c = *p++) == 't') c = '\t'; + else if (c == 'v') + c = '\v'; else if (c == 'n') c = '\n'; else if (c == 'f') @@ -268,6 +270,8 @@ int quoted(uschar **pp) /* pick up next thing after a \\ */ c = '\r'; else if (c == 'b') c = '\b'; + else if (c == 'a') + c = '\007'; else if (c == '\\') c = '\\'; else if (c == 'x') { /* hexadecimal goo follows */ diff --git a/usr.bin/awk/tran.c b/usr.bin/awk/tran.c index 6bebe2e9047..1105b5d4fe3 100644 --- a/usr.bin/awk/tran.c +++ b/usr.bin/awk/tran.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tran.c,v 1.16 2017/10/09 14:51:31 deraadt Exp $ */ +/* $OpenBSD: tran.c,v 1.17 2018/01/24 16:28:25 millert Exp $ */ /**************************************************************** Copyright (C) Lucent Technologies 1997 All Rights Reserved @@ -434,9 +434,11 @@ char *qstring(const char *is, int delim) /* collect string up to next delim */ case '\\': *bp++ = '\\'; break; case 'n': *bp++ = '\n'; break; case 't': *bp++ = '\t'; break; + case 'v': *bp++ = '\v'; break; case 'b': *bp++ = '\b'; break; case 'f': *bp++ = '\f'; break; case 'r': *bp++ = '\r'; break; + case 'a': *bp++ = '\007'; break; default: if (!isdigit(c)) { *bp++ = c; |