summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2010-09-29 22:24:18 +0000
committerjilles <jilles@FreeBSD.org>2010-09-29 22:24:18 +0000
commit26abe50bf104fe7fd516f6a3d577d8d487da19ec (patch)
tree1de27a5730d8afc2b3b9fe46d97090b19fd7c0e8 /tools
parent15603271578efc774546f5e1ce9fda0f2b5e5898 (diff)
downloadFreeBSD-src-26abe50bf104fe7fd516f6a3d577d8d487da19ec.zip
FreeBSD-src-26abe50bf104fe7fd516f6a3d577d8d487da19ec.tar.gz
tr: Fix '[=]=]' equivalence class.
A closing bracket immediately after '[=' should not be treated as special. Different from the submitted patch, a string ending with '[=' does not cause access beyond the terminating '\0'. PR: bin/150384 Submitted by: Richard Lowe MFC after: 2 weeks
Diffstat (limited to 'tools')
-rw-r--r--tools/regression/usr.bin/tr/regress.0c.out1
-rw-r--r--tools/regression/usr.bin/tr/regress.0d.out1
-rw-r--r--tools/regression/usr.bin/tr/regress.sh4
3 files changed, 5 insertions, 1 deletions
diff --git a/tools/regression/usr.bin/tr/regress.0c.out b/tools/regression/usr.bin/tr/regress.0c.out
new file mode 100644
index 0000000..4e125ea
--- /dev/null
+++ b/tools/regression/usr.bin/tr/regress.0c.out
@@ -0,0 +1 @@
+[[[[
diff --git a/tools/regression/usr.bin/tr/regress.0d.out b/tools/regression/usr.bin/tr/regress.0d.out
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/tools/regression/usr.bin/tr/regress.0d.out
@@ -0,0 +1 @@
+
diff --git a/tools/regression/usr.bin/tr/regress.sh b/tools/regression/usr.bin/tr/regress.sh
index c448b6d..badef15 100644
--- a/tools/regression/usr.bin/tr/regress.sh
+++ b/tools/regression/usr.bin/tr/regress.sh
@@ -1,6 +1,6 @@
# $FreeBSD$
-echo 1..12
+echo 1..14
REGRESSION_START($1)
@@ -16,5 +16,7 @@ REGRESSION_TEST(`08', `tr "[[:upper:]]" "[[:lower:]]" < regress2.in | tr -d "[^[
REGRESSION_TEST(`09', `printf "\\f\\r\\n" | tr "\\014\\r" "?#"')
REGRESSION_TEST(`0a', `printf "0xdeadbeef\\n" | tr "x[[:xdigit:]]" "?\$"')
REGRESSION_TEST(`0b', `(tr -cd "[[:xdigit:]]" < regress2.in ; echo)')
+REGRESSION_TEST(`0c', `echo "[[[[]]]]" | tr -d "[=]=]"')
+REGRESSION_TEST(`0d', `echo "]=[" | tr -d "[=]"')
REGRESSION_END()
OpenPOWER on IntegriCloud