APPROVE COMMIT 21.5
Not needed for 21.4.
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.801
diff -u -U0 -r1.801 ChangeLog
--- src/ChangeLog 2 Mar 2005 18:31:55 -0000 1.801
+++ src/ChangeLog 9 Mar 2005 04:57:21 -0000
@@ -0,0 +1,6 @@
+2005-01-13 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * regex.c (re_match_2_internal):
+ * regex.h (struct re_pattern_buffer):
+ Improve comments. Add a DEBUG_PRINT2 for null matches.
+
Index: src/regex.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/regex.c,v
retrieving revision 1.55
diff -u -r1.55 regex.c
--- src/regex.c 24 Jan 2005 23:34:08 -0000 1.55
+++ src/regex.c 9 Mar 2005 04:58:05 -0000
@@ -5178,8 +5178,9 @@
: ((regoff_t) (d - string2 + size1)));
}
- /* Go through the first `min (num_regs, regs->num_regs)'
- registers, since that is all we initialized. */
+ /* Map over the NUM_NONSHY_REGS non-shy internal registers.
+ Copy each into the corresponding external register.
+ MCNT indexes external registers. */
for (mcnt = 1; mcnt < MIN (num_nonshy_regs, regs->num_regs);
mcnt++)
{
@@ -5198,9 +5199,10 @@
} /* regs && !bufp->no_sub */
/* If we have regs and the regs structure has more elements than
- were in the pattern, set the extra elements to -1. If we
- (re)allocated the registers, this is the case, because we
- always allocate enough to have at least one -1 at the end.
+ were in the pattern, set the extra elements starting with
+ NUM_NONSHY_REGS to -1. If we (re)allocated the registers,
+ this is the case, because we always allocate enough to have
+ at least one -1 at the end.
We do this even when no_sub is set because some applications
(XEmacs) reuse register structures which may contain stale
@@ -5406,8 +5408,11 @@
p1 = p; /* To send to group_match_null_string_p. */
if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
- REG_MATCH_NULL_STRING_P (reg_info[*p])
- = group_match_null_string_p (&p1, pend, reg_info);
+ REG_MATCH_NULL_STRING_P (reg_info[*p])
+ = group_match_null_string_p (&p1, pend, reg_info);
+
+ DEBUG_PRINT2 (" group CAN%s match null string\n",
+ REG_MATCH_NULL_STRING_P (reg_info[*p]) ? "NOT" : "");
/* Save the position in the string where we were the last time
we were at this open-group operator in case the group is
Index: src/regex.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/regex.h,v
retrieving revision 1.13
diff -u -r1.13 regex.h
--- src/regex.h 14 Oct 2004 17:26:24 -0000 1.13
+++ src/regex.h 9 Mar 2005 04:58:05 -0000
@@ -357,8 +357,8 @@
when it is matched. */
RE_TRANSLATE_TYPE translate;
- /* Number of returnable groups found by the compiler. (This does
- not count shy groups.) */
+ /* Number of subpatterns (returnable groups) found by the compiler.
+ (This does not count shy groups.) */
int re_nsub;
/* Total number of groups found by the compiler. (Including
--
Institute of Policy and Planning Sciences
http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Ask not how you can "do" free software business;
ask what your business can "do for" free software.