RECOMMEND 21.4
Vin,
The test attached was suggested by Julian Bradfield. This test should
be applied in any case.
I believe his fix to regex.c is correct, see
<87hc6rv53v.fsf(a)uwakimon.sk.tsukuba.ac.jp> on xemacs-patches.
Index: src/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.290.2.123
diff -u -r1.290.2.123 ChangeLog
--- src/ChangeLog 8 Oct 2007 01:22:54 -0000 1.290.2.123
+++ src/ChangeLog 1 Nov 2008 15:21:25 -0000
@@ -0,0 +1,5 @@
+2008-11-01 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * regex.c (re_search_2): Fix at_dot by changing charpos to bytepos.
+ From Julian Bradfield <18654.1143.304851.782755(a)krk.inf.ed.ac.uk>.
+
Index: tests/ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/ChangeLog,v
retrieving revision 1.2.2.48
diff -u -r1.2.2.48 ChangeLog
--- tests/ChangeLog 8 Oct 2007 01:23:15 -0000 1.2.2.48
+++ tests/ChangeLog 1 Nov 2008 15:21:25 -0000
@@ -0,0 +1,4 @@
+2008-09-27 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * automated/regexp-tests.el: Add test for at_dot regexp.
+
Index: src/regex.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/regex.c,v
retrieving revision 1.25.2.14
diff -u -r1.25.2.14 regex.c
--- src/regex.c 31 Mar 2006 01:29:00 -0000 1.25.2.14
+++ src/regex.c 1 Nov 2008 15:21:25 -0000
@@ -4075,7 +4075,7 @@
don't keep searching past point. */
if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == at_dot
&& range > 0)
{
- range = BUF_PT (regex_emacs_buffer) - BUF_BEGV (regex_emacs_buffer)
+ range = BI_BUF_PT (regex_emacs_buffer) - BI_BUF_BEGV (regex_emacs_buffer)
- startpos;
if (range < 0)
return -1;
Index: tests/automated/regexp-tests.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/tests/automated/regexp-tests.el,v
retrieving revision 1.2.2.10
diff -u -r1.2.2.10 regexp-tests.el
--- tests/automated/regexp-tests.el 2 Feb 2005 03:40:01 -0000 1.2.2.10
+++ tests/automated/regexp-tests.el 1 Nov 2008 15:21:25 -0000
@@ -449,3 +449,20 @@
(not (match-beginning 1))))
)
+;; empty string at point
+;; Thanks Julian Bradford on XEmacs Beta
+;; <18652.54975.894512.880956(a)krk.inf.ed.ac.uk>
+(with-string-as-buffer-contents "aáa"
+ (goto-char (point-min))
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 1))
+ (forward-char 1)
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 2))
+ (forward-char 1)
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 3))
+ (forward-char 1)
+ (Assert (looking-at "\\="))
+ (Assert (= (re-search-forward "\\=") 4)))
+
_______________________________________________
XEmacs-Patches mailing list
XEmacs-Patches(a)xemacs.org
http://calypso.tux.org/cgi-bin/mailman/listinfo/xemacs-patches