]> sourceware.org Git - glibc.git/commitdiff
Add test case for last fixed regex bug.
authorUlrich Drepper <drepper@redhat.com>
Sun, 23 Aug 2009 22:33:40 +0000 (15:33 -0700)
committerUlrich Drepper <drepper@redhat.com>
Sun, 23 Aug 2009 22:33:40 +0000 (15:33 -0700)
ChangeLog
posix/Makefile
posix/bug-regex29.c [new file with mode: 0644]

index 37cd868c19277e1ed8b6af8019d27d76fa6ce767..9f63c4db05bd894d6456c621ad9054ffd2356506 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,8 @@
 
        * posix/regcomp.c (parse_dup_op): Verify the expression is correctly
        terminated.
+       * posix/Makefile (tests): Add bug-regex29.
+       * posix/bug-regex29.c: New file.
 
        * posix/unistd.h: Define _POSIX_VERSION and _POSIX2_* correctly if
        older POSIX versions are selected.
index 8d8fbe52346a3a2757c1eaef7f199a5eea268a5b..c9ce18b94e95f790815935d4d0dea5ce372d2779 100644 (file)
@@ -82,6 +82,7 @@ tests         := tstgetopt testfnm runtests runptests      \
                   bug-regex17 bug-regex18 bug-regex19 bug-regex20 \
                   bug-regex21 bug-regex22 bug-regex23 bug-regex24 \
                   bug-regex25 bug-regex26 bug-regex27 bug-regex28 \
+                  bug-regex29 \
                   tst-nice tst-nanosleep tst-regex2 \
                   transbug tst-rxspencer tst-pcre tst-boost \
                   bug-ga1 tst-vfork1 tst-vfork2 tst-vfork3 tst-waitid \
diff --git a/posix/bug-regex29.c b/posix/bug-regex29.c
new file mode 100644 (file)
index 0000000..70a6c94
--- /dev/null
@@ -0,0 +1,15 @@
+#include <regex.h>
+
+static int
+do_test (void)
+{
+  regex_t r;
+  int e = regcomp(&r, "xy\\{4,5,7\\}zabc", 0);
+  char buf[100];
+  regerror(e, &r, buf, sizeof (buf));
+  printf ("e = %d (%s)\n", e, buf);
+  return e != REG_BADBR;
+}
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
This page took 0.053358 seconds and 5 git commands to generate.