summary refs log tree commit diff
path: root/posix/bug-regex13.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-12-22 06:52:35 +0000
committerUlrich Drepper <drepper@redhat.com>2003-12-22 06:52:35 +0000
commit1cef7b3caef9c520148f15511ec193dcce80d1b2 (patch)
tree8acf73aea465bfc031b6012c4164f3ff43206286 /posix/bug-regex13.c
parent7de661083b26a7cba6d136f7b7311e732c0ff9e0 (diff)
downloadglibc-1cef7b3caef9c520148f15511ec193dcce80d1b2.tar.gz
glibc-1cef7b3caef9c520148f15511ec193dcce80d1b2.tar.xz
glibc-1cef7b3caef9c520148f15511ec193dcce80d1b2.zip
Update.
2003-12-21  Jakub Jelinek  <jakub@redhat.com>

	* posix/regcomp.c (duplicate_node, duplicate_node_closure): Revert
	2003-11-24 changes.
	* posix/regexec.c (group_nodes_into_DFAstates): For CHARACTER with
	NEXT_{,NOT}WORD_CONSTRAINT check word_char bit.
	* posix/bug-regex19.c (tests): Add new tests.

	* posix/regexec.c (check_dst_limits_calc_pos): Fix formatting.

	* posix/regcomp.c (parse_dup_op): Return NULL if dup_elem is NULL,
	after checking syntax.  Optimize.
	(calc_first): Fix comment.
	* posix/bug-regex13.c (tests): Add new tests.
Diffstat (limited to 'posix/bug-regex13.c')
-rw-r--r--posix/bug-regex13.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/posix/bug-regex13.c b/posix/bug-regex13.c
index e6b0ca1ecf..df1c95d64c 100644
--- a/posix/bug-regex13.c
+++ b/posix/bug-regex13.c
@@ -34,7 +34,33 @@ static struct
 } tests[] = {
   {RE_BACKSLASH_ESCAPE_IN_LISTS, "[0\\-9]", "1", -1}, /* It should not match.  */
   {RE_BACKSLASH_ESCAPE_IN_LISTS, "[0\\-9]", "-", 0}, /* It should match.  */
-  {RE_SYNTAX_POSIX_BASIC, "s1\n.*\ns3", "s1\ns2\ns3", 0}
+  {RE_SYNTAX_POSIX_BASIC, "s1\n.*\ns3", "s1\ns2\ns3", 0},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}c", "ac", 0},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}c", "abc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}c", "abbc", -1},
+  /* Nested duplication.  */
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{1}c", "ac", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{1}c", "abc", 0},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{1}c", "abbc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{2}{2}c", "ac", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{2}{2}c", "abbc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{2}{2}c", "abbbbc", 0},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{2}{2}c", "abbbbbc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}{1}c", "ac", 0},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}{1}c", "abc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}{1}c", "abbc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{0}c", "ac", 0},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{0}c", "abc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{1}{0}c", "abbc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}*c", "ac", 0},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}*c", "abc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}*c", "abbc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}?c", "ac", 0},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}?c", "abc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}?c", "abbc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}+c", "ac", 0},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}+c", "abc", -1},
+  {RE_SYNTAX_POSIX_EXTENDED, "ab{0}+c", "abbc", -1},
 };
 
 int