From 3f2fb22342acc2f14e9662fd157955fd6a9814e5 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 10 Mar 2004 06:46:51 +0000 Subject: [BZ #16] Update. 2004-03-09 Ulrich Drepper * stdlib/qsort.c (_quicksort): Initialize first stack element [BZ #16]. 2004-03-05 Jakub Jelinek * 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. --- posix/regexec.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'posix/regexec.c') 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 +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. */ -- cgit v1.1