changeset 29194:fe06affca294

(at_begline_loc_p): Also recognize the \\(?:^ case of an anchor at the beginning of a shy-group.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Thu, 25 May 2000 16:30:40 +0000
parents eb1c9224a1c6
children 1da5b007c8c5
files src/regex.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/regex.c	Thu May 25 15:59:47 2000 +0000
+++ b/src/regex.c	Thu May 25 16:30:40 2000 +0000
@@ -3208,7 +3208,12 @@
        /* After a subexpression?  */
        (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
        /* After an alternative?	 */
-    || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
+    || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash))
+       /* After a shy subexpression?  */
+    || ((syntax & RE_SHY_GROUPS) && prev - 2 >= pattern
+	&& prev[-1] == '?' && prev[-2] == '('
+	&& (syntax & RE_NO_BK_PARENS
+	    || (prev - 3 >= pattern && prev[-3] == '\\')));
 }