summaryrefslogtreecommitdiff
path: root/testsuite
diff options
context:
space:
mode:
authorPaolo Bonzini <bonzini@gnu.org>2009-05-11 10:30:54 +0200
committerPaolo Bonzini <bonzini@gnu.org>2009-05-11 10:47:06 +0200
commit601f290184a39dd78545b3f833c5c00f8a97a3ca (patch)
treedca6866f66a8b7cbd7e5d611b066e5e0e1697ecb /testsuite
parentff839b08be5e2ed97bc29639d4844ae1a1ba6d66 (diff)
downloadsed-601f290184a39dd78545b3f833c5c00f8a97a3ca.tar.gz
fix bug with s/[[[]//
2009-05-11 Paolo Bonzini <bonzini@gnu.org> * sed/compile.c (snarf_char_class): Fix logic bug with [[[ in regular expressions (and a possibly uninitialized use of variable delim stemming from the bug). Uninitialized variable bug reported by Zhongxing Xu. * testsuite/brackets.good: New. * testsuite/brackets.inp: New. * testsuite/brackets.sed: New. * testsuite/Makefile.am: Add test. * testsuite/Makefile.tests: Add test. 2009-05-11 Paolo Bonzini <bonzini@gnu.org>
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/Makefile.am3
-rw-r--r--testsuite/Makefile.tests2
-rw-r--r--testsuite/brackets.good1
-rw-r--r--testsuite/brackets.inp1
-rw-r--r--testsuite/brackets.sed8
5 files changed, 13 insertions, 2 deletions
diff --git a/testsuite/Makefile.am b/testsuite/Makefile.am
index 47062e0..b8e60cb 100644
--- a/testsuite/Makefile.am
+++ b/testsuite/Makefile.am
@@ -24,7 +24,7 @@ SEDTESTS += \
fasts uniq manis khadafy linecnt eval distrib 8to7 y-bracket \
y-newline allsub cv-vars classes middle bsd stdin flipcase \
insens subwrite writeout readin insert utf8-1 utf8-2 utf8-3 utf8-4 \
- badenc inplace-hold \
+ badenc inplace-hold brackets \
help version file quiet \
factor binary3 binary2 binary dc
@@ -42,6 +42,7 @@ EXTRA_DIST = \
appquit.good appquit.inp appquit.sed \
binary.good binary.inp binary.sed binary2.sed binary3.sed \
bkslashes.good bkslashes.inp bkslashes.sed \
+ brackets.good brackets.inp brackets.sed \
bsd.good bsd.sh \
cv-vars.good cv-vars.inp cv-vars.sed \
classes.good classes.inp classes.sed \
diff --git a/testsuite/Makefile.tests b/testsuite/Makefile.tests
index f6402dd..1f04290 100644
--- a/testsuite/Makefile.tests
+++ b/testsuite/Makefile.tests
@@ -21,7 +21,7 @@ SKIP = :>$@.skip; exit 77
enable sep inclib 8bit 8to7 newjis xabcx dollar noeol bkslashes \
numsub head madding mac-mf empty xbxcx xbxcx3 recall recall2 xemacs \
appquit fasts uniq manis linecnt khadafy allsub flipcase space modulo \
-y-bracket y-newline insert::
+y-bracket y-newline insert brackets::
$(SEDENV) $(SED) -f $(srcdir)/$@.sed \
< $(srcdir)/$@.inp | $(TR) -d \\r > $@.out
$(CMP) $(srcdir)/$@.good $@.out
diff --git a/testsuite/brackets.good b/testsuite/brackets.good
new file mode 100644
index 0000000..73f87e7
--- /dev/null
+++ b/testsuite/brackets.good
@@ -0,0 +1 @@
+abcdefgh[
diff --git a/testsuite/brackets.inp b/testsuite/brackets.inp
new file mode 100644
index 0000000..3cc5802
--- /dev/null
+++ b/testsuite/brackets.inp
@@ -0,0 +1 @@
+[[[[[[[[[
diff --git a/testsuite/brackets.sed b/testsuite/brackets.sed
new file mode 100644
index 0000000..3c70da8
--- /dev/null
+++ b/testsuite/brackets.sed
@@ -0,0 +1,8 @@
+s/[[]/a/
+s/[[[]/b/
+s/[[[[]/c/
+s/[[[[[]/d/
+s/[[[[[[]/e/
+s/[[[[[[[]/f/
+s/[[[[[[[[]/g/
+s/[[[[[[[[[]/h/