summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-03-10 06:46:51 +0000
committerUlrich Drepper <drepper@redhat.com>2004-03-10 06:46:51 +0000
commit3f2fb22342acc2f14e9662fd157955fd6a9814e5 (patch)
tree5194d4ba22d545d09063bafdb0170184a89cf033 /posix
parentf4c024d1f956a7e853eba10ce33ab6851b5d43d1 (diff)
[BZ #16]
Update. 2004-03-09 Ulrich Drepper <drepper@redhat.com> * stdlib/qsort.c (_quicksort): Initialize first stack element [BZ #16]. 2004-03-05 Jakub Jelinek <jakub@redhat.com> * posix/regexec.c (regexec): Return with error on unknown eflags. Replace weak_alias with versioned_symbol. (__compat_regexec): New. * posix/Versions (libc): Add regexec@GLIBC_2.3.4.
Diffstat (limited to 'posix')
-rw-r--r--posix/Versions3
-rw-r--r--posix/regexec.c22
2 files changed, 24 insertions, 1 deletions
diff --git a/posix/Versions b/posix/Versions
index c68594acb5..4e6f200aa0 100644
--- a/posix/Versions
+++ b/posix/Versions
@@ -119,6 +119,9 @@ libc {
GLIBC_2.3.3 {
sched_getaffinity; sched_setaffinity;
}
+ GLIBC_2.3.4 {
+ regexec;
+ }
GLIBC_PRIVATE {
# functions which have an additional interface since they are
# are cancelable.
diff --git a/posix/regexec.c b/posix/regexec.c
index ad62178bbd..88d05b5dbe 100644
--- a/posix/regexec.c
+++ b/posix/regexec.c
@@ -216,6 +216,10 @@ regexec (preg, string, nmatch, pmatch, eflags)
{
reg_errcode_t err;
int start, length;
+
+ if (eflags & ~(REG_NOTBOL | REG_NOTEOL | REG_STARTEND))
+ return REG_BADPAT;
+
if (eflags & REG_STARTEND)
{
start = pmatch[0].rm_so;
@@ -234,8 +238,24 @@ regexec (preg, string, nmatch, pmatch, eflags)
length, nmatch, pmatch, eflags);
return err != REG_NOERROR;
}
+
#ifdef _LIBC
-weak_alias (__regexec, regexec)
+# include <shlib-compat.h>
+versioned_symbol (libc, __regexec, regexec, GLIBC_2_3_4);
+
+# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
+__typeof__ (__regexec) __compat_regexec;
+
+int
+__compat_regexec (const regex_t *__restrict preg,
+ const char *__restrict string, size_t nmatch,
+ regmatch_t pmatch[], int eflags)
+{
+ return regexec (preg, string, nmatch, pmatch,
+ eflags & (REG_NOTBOL | REG_NOTEOL));
+}
+compat_symbol (libc, __compat_regexec, regexec, GLIBC_2_0);
+# endif
#endif
/* Entry points for GNU code. */