User: stephent
Date: 05/03/09 05:59:44
Modified: xemacs/src ChangeLog regex.c regex.h
Log:
small regex doc patch <876501fmab.fsf(a)tleepslib.sk.tsukuba.ac.jp>
Revision Changes Path
1.802 +6 -0 XEmacs/xemacs/src/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.801
retrieving revision 1.802
diff -u -r1.801 -r1.802
--- ChangeLog 2005/03/02 18:31:55 1.801
+++ ChangeLog 2005/03/09 04:59:25 1.802
@@ -1,3 +1,9 @@
+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.
+
2005-03-02 Aidan Kehoe <kehoea(a)parhasard.net>
* select-x.c (x_reply_selection_request): Check that
1.56 +12 -7 XEmacs/xemacs/src/regex.c
Index: regex.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/regex.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- regex.c 2005/01/24 23:34:08 1.55
+++ regex.c 2005/03/09 04:59:31 1.56
@@ -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
1.14 +2 -2 XEmacs/xemacs/src/regex.h
Index: regex.h
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/regex.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- regex.h 2004/10/14 17:26:24 1.13
+++ regex.h 2005/03/09 04:59:31 1.14
@@ -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