aboutsummaryrefslogtreecommitdiff
path: root/b.c
diff options
context:
space:
mode:
authorMartijn Dekker <martijn@inlv.org>2019-07-26 10:46:58 +0200
committerArnold Robbins <arnold@skeeve.com>2019-07-26 11:46:58 +0300
commit5b602ca8a2c939e930ea84347ed5c9de256049f3 (patch)
tree0c98f4e6037dbb034d2864457041f190abd9effc /b.c
parent4e34346094e52de09cf9d4f9ae632e81bfe0f981 (diff)
downloadone-true-awk-5b602ca8a2c939e930ea84347ed5c9de256049f3.tar.gz
Add support for "\a" and "\v" to regex and command line args (#44)
Support POSIX-specified C-style escape sequences "\a" (alarm) and "\v" (vertical tab) in command line arguments and regular expressions, further to the support for them in strings added on Apr 9, 1989. These now no longer match as literal "a" and "v" characters (as they don't on gawk and mawk). IOW, lex.c already supported these (lines 390-391 as of 4e343460); the support needed to be added to b.c and tran.c. Relevant POSIX reference: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html#tag_20_06_13_04
Diffstat (limited to 'b.c')
-rw-r--r--b.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/b.c b/b.c
index 3f6745c..91dd78d 100644
--- a/b.c
+++ b/b.c
@@ -279,6 +279,10 @@ int quoted(uschar **pp) /* pick up next thing after a \\ */
c = '\r';
else if (c == 'b')
c = '\b';
+ else if (c == 'v')
+ c = '\v';
+ else if (c == 'a')
+ c = '\a';
else if (c == '\\')
c = '\\';
else if (c == 'x') { /* hexadecimal goo follows */