summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2009-08-24 10:15:51 +0200
committerAndreas Schwab <schwab@redhat.com>2009-08-24 10:15:51 +0200
commit255acd161cc2d7752a4e79234dcba5d929c3e0a4 (patch)
tree94c1d111cce2137ee948ff0e9d735f7a3643ef78 /posix
parent593eff0f9e5bed517e0a8434507ee9f3f4d45b87 (diff)
parenta0e25a886a9128b280b4c05bc9c6dd12377ea868 (diff)
Merge commit 'origin/master' into fedora/master
Conflicts: sysdeps/powerpc/powerpc64/____longjmp_chk.S sysdeps/unix/sysv/linux/powerpc/powerpc64/____longjmp_chk.S
Diffstat (limited to 'posix')
-rw-r--r--posix/Makefile1
-rw-r--r--posix/bug-regex29.c15
-rw-r--r--posix/regcomp.c2
-rw-r--r--posix/unistd.h40
4 files changed, 51 insertions, 7 deletions
diff --git a/posix/Makefile b/posix/Makefile
index 3c3ccfad55..c0164effa8 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -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
index 0000000000..70a6c94cc6
--- /dev/null
+++ b/posix/bug-regex29.c
@@ -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"
diff --git a/posix/regcomp.c b/posix/regcomp.c
index 4843cfea33..446fed5445 100644
--- a/posix/regcomp.c
+++ b/posix/regcomp.c
@@ -2481,7 +2481,7 @@ parse_dup_op (bin_tree_t *elem, re_string_t *regexp, re_dfa_t *dfa,
return elem;
}
- if (BE (end != -1 && start > end, 0))
+ if (BE ((end != -1 && start > end) || token->type != OP_CLOSE_DUP_NUM, 0))
{
/* First number greater than second. */
*err = REG_BADBR;
diff --git a/posix/unistd.h b/posix/unistd.h
index cbab9f939e..d9ecb5e788 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -30,30 +30,58 @@ __BEGIN_DECLS
/* These may be used to determine what facilities are present at compile time.
Their values can be obtained at run time from `sysconf'. */
+#ifdef __USE_XOPEN2K8
/* POSIX Standard approved as ISO/IEC 9945-1 as of September 2008. */
-#define _POSIX_VERSION 200809L
+# define _POSIX_VERSION 200809L
+#elif defined __USE_XOPEN2K
+/* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001. */
+# define _POSIX_VERSION 200112L
+#elif defined __USE_POSIX199506
+/* POSIX Standard approved as ISO/IEC 9945-1 as of June 1995. */
+# define _POSIX_VERSION 199506L
+#elif defined __USE_POSIX199309
+/* POSIX Standard approved as ISO/IEC 9945-1 as of September 1993. */
+# define _POSIX_VERSION 199309L
+#else
+/* POSIX Standard approved as ISO/IEC 9945-1 as of September 1990. */
+# define _POSIX_VERSION 199009L
+#endif
/* These are not #ifdef __USE_POSIX2 because they are
in the theoretically application-owned namespace. */
+#ifdef __USE_XOPEN2K8
+# define __POSIX2_THIS_VERSION 200809L
+/* The utilities on GNU systems also correspond to this version. */
+#elif defined __USE_XOPEN2K
+/* The utilities on GNU systems also correspond to this version. */
+# define __POSIX2_THIS_VERSION 200112L
+#elif defined __USE_POSIX199506
+/* The utilities on GNU systems also correspond to this version. */
+# define __POSIX2_THIS_VERSION 199506L
+#else
+/* The utilities on GNU systems also correspond to this version. */
+# define __POSIX2_THIS_VERSION 199209L
+#endif
+
/* The utilities on GNU systems also correspond to this version. */
-#define _POSIX2_VERSION 200809L
+#define _POSIX2_VERSION __POSIX2_THIS_VERSION
/* If defined, the implementation supports the
C Language Bindings Option. */
-#define _POSIX2_C_BIND 200809L
+#define _POSIX2_C_BIND __POSIX2_THIS_VERSION
/* If defined, the implementation supports the
C Language Development Utilities Option. */
-#define _POSIX2_C_DEV 200809L
+#define _POSIX2_C_DEV __POSIX2_THIS_VERSION
/* If defined, the implementation supports the
Software Development Utilities Option. */
-#define _POSIX2_SW_DEV 200809L
+#define _POSIX2_SW_DEV __POSIX2_THIS_VERSION
/* If defined, the implementation supports the
creation of locales with the localedef utility. */
-#define _POSIX2_LOCALEDEF 200809L
+#define _POSIX2_LOCALEDEF __POSIX2_THIS_VERSION
/* X/Open version number to which the library conforms. It is selectable. */
#ifdef __USE_XOPEN2K8