diff options
author | Christian Weisgerber <naddy@cvs.openbsd.org> | 2010-07-01 17:04:25 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@cvs.openbsd.org> | 2010-07-01 17:04:25 +0000 |
commit | 182e947e13afa8bdf48abca878046f822e1d324d (patch) | |
tree | 206c652ba58933ad90ad0e72b6235e23499e30b0 /regress | |
parent | 3269b215277e7b004ef6c5cb1b64da4552cc625c (diff) |
Follow POSIX (IEEE Std 1003.1, 2004 Edition) in the implementation
of the y (translate) command.
"If a backslash character is immediately followed by a backslash
character in string1 or string2, the two backslash characters shall
be counted as a single literal backslash character"
From FreeBSD; ok millert@ halex@
Diffstat (limited to 'regress')
-rw-r--r-- | regress/usr.bin/sed/sedtest.expected | 6 | ||||
-rw-r--r-- | regress/usr.bin/sed/sedtest.sh | 6 |
2 files changed, 11 insertions, 1 deletions
diff --git a/regress/usr.bin/sed/sedtest.expected b/regress/usr.bin/sed/sedtest.expected index 38a934093ff..48f9c63d592 100644 --- a/regress/usr.bin/sed/sedtest.expected +++ b/regress/usr.bin/sed/sedtest.expected @@ -4561,3 +4561,9 @@ X[_11 X[_12 X[_13 X[_14 +\ in y command + +============= +Test 8.20:189 +============= +a-b-c diff --git a/regress/usr.bin/sed/sedtest.sh b/regress/usr.bin/sed/sedtest.sh index f350dd736f0..56e68b23450 100644 --- a/regress/usr.bin/sed/sedtest.sh +++ b/regress/usr.bin/sed/sedtest.sh @@ -1,5 +1,5 @@ #!/bin/sh - -# $OpenBSD: sedtest.sh,v 1.2 2010/07/01 17:02:02 naddy Exp $ +# $OpenBSD: sedtest.sh,v 1.3 2010/07/01 17:04:24 naddy Exp $ # # Copyright (c) 1992 Diomidis Spinellis. # Copyright (c) 1992, 1993 @@ -415,6 +415,10 @@ u2/g' lines1 # if it is preceded by a backslash mark '8.18' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X[' mark '8.19' ; sed 's/l/[/' lines1 | $SED -e 's[\[.[X\[[' + echo '\ in y command' + mark '8.20' + printf 'a\\b(c' | + $SED 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' } test_error() |