aboutsummaryrefslogtreecommitdiff
path: root/posix/regexec.c
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/regexec.c
parentf4c024d1f956a7e853eba10ce33ab6851b5d43d1 (diff)
downloadglibc-3f2fb22342acc2f14e9662fd157955fd6a9814e5.zip
glibc-3f2fb22342acc2f14e9662fd157955fd6a9814e5.tar.gz
glibc-3f2fb22342acc2f14e9662fd157955fd6a9814e5.tar.bz2
[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/regexec.c')
-rw-r--r--posix/regexec.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/posix/regexec.c b/posix/regexec.c
index ad62178..88d05b5 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. */