mirror of
https://sourceware.org/git/glibc.git
synced 2024-09-20 00:19:57 +00:00
Update.
2004-01-15 Paolo Bonzini <bonzini@gnu.org> * posix/regex.h (REG_STARTEND): Define. * posix/regexec.c (regexec): Check for REG_STARTEND.
This commit is contained in:
parent
4c595adb60
commit
6fefb4e0b1
@ -1,3 +1,8 @@
|
|||||||
|
2004-01-15 Paolo Bonzini <bonzini@gnu.org>
|
||||||
|
|
||||||
|
* posix/regex.h (REG_STARTEND): Define.
|
||||||
|
* posix/regexec.c (regexec): Check for REG_STARTEND.
|
||||||
|
|
||||||
2004-02-29 Paolo Bonzini <bonzini@gnu.org>
|
2004-02-29 Paolo Bonzini <bonzini@gnu.org>
|
||||||
|
|
||||||
* posix/regexec.c (transit_state): Don't handle state == NULL.
|
* posix/regexec.c (transit_state): Don't handle state == NULL.
|
||||||
|
@ -298,6 +298,10 @@ extern reg_syntax_t re_syntax_options;
|
|||||||
/* Like REG_NOTBOL, except for the end-of-line. */
|
/* Like REG_NOTBOL, except for the end-of-line. */
|
||||||
#define REG_NOTEOL (1 << 1)
|
#define REG_NOTEOL (1 << 1)
|
||||||
|
|
||||||
|
/* Use PMATCH[0] to delimit the start and end of the search in the
|
||||||
|
buffer. */
|
||||||
|
#define REG_STARTEND (1 << 2)
|
||||||
|
|
||||||
|
|
||||||
/* If any error codes are removed, changed, or added, update the
|
/* If any error codes are removed, changed, or added, update the
|
||||||
`re_error_msg' table in regex.c. */
|
`re_error_msg' table in regex.c. */
|
||||||
|
@ -215,13 +215,23 @@ regexec (preg, string, nmatch, pmatch, eflags)
|
|||||||
int eflags;
|
int eflags;
|
||||||
{
|
{
|
||||||
reg_errcode_t err;
|
reg_errcode_t err;
|
||||||
int length = strlen (string);
|
int start, length;
|
||||||
if (preg->no_sub)
|
if (eflags & REG_STARTEND)
|
||||||
err = re_search_internal (preg, string, length, 0, length, length, 0,
|
{
|
||||||
NULL, eflags);
|
start = pmatch[0].rm_so;
|
||||||
|
length = pmatch[0].rm_eo;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
err = re_search_internal (preg, string, length, 0, length, length, nmatch,
|
{
|
||||||
pmatch, eflags);
|
start = 0;
|
||||||
|
length = strlen (string);
|
||||||
|
}
|
||||||
|
if (preg->no_sub)
|
||||||
|
err = re_search_internal (preg, string, length, start, length - start,
|
||||||
|
length, 0, NULL, eflags);
|
||||||
|
else
|
||||||
|
err = re_search_internal (preg, string, length, start, length - start,
|
||||||
|
length, nmatch, pmatch, eflags);
|
||||||
return err != REG_NOERROR;
|
return err != REG_NOERROR;
|
||||||
}
|
}
|
||||||
#ifdef _LIBC
|
#ifdef _LIBC
|
||||||
|
Loading…
Reference in New Issue
Block a user