projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[gnulib.git]
/
regex.c
diff --git
a/regex.c
b/regex.c
index
cb94d59
..
4d617d3
100644
(file)
--- a/
regex.c
+++ b/
regex.c
@@
-1302,6
+1302,7
@@
regex_compile (pattern, size, syntax, bufp)
the `*'. Do we have to do something analogous here
for null bytes, because of RE_DOT_NOT_NULL? */
if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
the `*'. Do we have to do something analogous here
for null bytes, because of RE_DOT_NOT_NULL? */
if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
+ && zero_times_ok
&& p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
&& !(syntax & RE_DOT_NEWLINE))
{ /* We have .*\n. */
&& p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
&& !(syntax & RE_DOT_NEWLINE))
{ /* We have .*\n. */
@@
-1612,6
+1613,10
@@
regex_compile (pattern, size, syntax, bufp)
fixup_alt_jump = 0;
laststart = 0;
begalt = b;
fixup_alt_jump = 0;
laststart = 0;
begalt = b;
+ /* If we've reached MAX_REGNUM groups, then this open
+ won't actually generate any code, so we'll have to
+ clear pending_exact explicitly. */
+ pending_exact = 0;
break;
break;
@@
-1661,6
+1666,10
@@
regex_compile (pattern, size, syntax, bufp)
: 0;
laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
this_group_regnum = COMPILE_STACK_TOP.regnum;
: 0;
laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
this_group_regnum = COMPILE_STACK_TOP.regnum;
+ /* If we've reached MAX_REGNUM groups, then this open
+ won't actually generate any code, so we'll have to
+ clear pending_exact explicitly. */
+ pending_exact = 0;
/* We're at the end of the group, so now we know how many
groups were inside this one. */
/* We're at the end of the group, so now we know how many
groups were inside this one. */
@@
-4881,6
+4890,13
@@
regerror (errcode, preg, errbuf, errbuf_size)
Dump core so we can fix it. */
abort ();
Dump core so we can fix it. */
abort ();
+ msg = re_error_msg[errcode];
+
+ /* POSIX doesn't require that we do anything in this case, but why
+ not be nice. */
+ if (! msg)
+ msg = "Success";
+
msg_size = strlen (msg) + 1; /* Includes the null. */
if (errbuf_size != 0)
msg_size = strlen (msg) + 1; /* Includes the null. */
if (errbuf_size != 0)