From xemacs-m  Sun Apr 13 13:41:24 1997
Received: from mailbox2.ucsd.edu (mailbox2.ucsd.edu [132.239.1.54])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id NAA04793
	for <xemacs-beta@xemacs.org>; Sun, 13 Apr 1997 13:41:23 -0500 (CDT)
Received: from sdnp5.ucsd.edu (sdnp5.ucsd.edu [132.239.79.10]) by mailbox2.ucsd.edu (8.8.5/8.6.9) with SMTP id LAA29036 for <xemacs-beta@xemacs.org>; Sun, 13 Apr 1997 11:41:24 -0700 (PDT)
Received: by sdnp5.ucsd.edu (SMI-8.6/SMI-SVR4)
	id LAA21688; Sun, 13 Apr 1997 11:42:54 -0700
To: xemacs-beta@xemacs.org
Subject: PATCH: mule regex bug (was Re: gnus-kill-file-kill-by-subject hangs)
References: <86ybanf0is.fsf@mycroft.kunitachi.tama.or.jp> <m2afn2lxp0.fsf@altair.xemacs.org> <rvu3la4xqg.fsf@sdnp5.ucsd.edu>
X-Face: "oX;zS#-JU$-,WKSzG.1gGE]x^cIg!hW.dq>.f6pzS^A+(k!T|M:}5{_%>Io<>L&{hO7W4cicOQ|>/lZ1G(m%7iaCf,6Qgk0%%Bz7b2-W3jd0m_UG\Y;?]}4s0O-U)uox>P3JN)9cm]O\@,vy2e{`3pb!"pqmRy3peB90*2L
Mail-Copies-To: never
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: multipart/mixed;
 boundary="Multipart_Sun_Apr_13_11:42:53_1997-1"
Content-Transfer-Encoding: 7bit
From: David Moore <dmoore@ucsd.edu>
Date: 13 Apr 1997 11:42:53 -0700
In-Reply-To: David Moore's message of 13 Apr 1997 10:51:51 -0700
Message-ID: <rvsp0u4vde.fsf_-_@sdnp5.ucsd.edu>
Lines: 41
X-Mailer: Gnus v5.4.45/XEmacs 20.1(beta15)

--Multipart_Sun_Apr_13_11:42:53_1997-1
Content-Type: text/plain; charset=ISO-2022-JP


> (string-match "\\`x"
> 	      "$B$_$s$J$G$*6b;}$A!*(B")


--Multipart_Sun_Apr_13_11:42:53_1997-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="regex.diff"
Content-Transfer-Encoding: 7bit

--- ChangeLog.orig	Sun Apr 13 11:35:06 1997
+++ ChangeLog	Sun Apr 13 11:40:59 1997
@@ -1,3 +1,8 @@
+Sun Apr 13 11:33:34 1997  David Moore  <dmoore@ucsd.edu>
+
+	* regex.c (re_search_2): Prevent incorrect matching and infinite
+	loop with \\` and MULE.
+
 Sat Apr 12 05:57:51 1997  Steven L Baur  <steve@altair.xemacs.org>
 
 	* Makefile.in.in (lisp): Dump cus-start.elc with XEmacs.
--- regex.c.orig	Sun Apr 13 11:34:55 1997
+++ regex.c	Sun Apr 13 11:40:59 1997
@@ -3892,7 +3892,11 @@
       if (startpos > 0)
 	return -1;
       else
-	range = 1;
+	{
+	  d = ((CONST unsigned char *)
+	       (startpos >= size1 ? string2 - size1 : string1) + startpos);
+	    range = charcount_to_bytecount (d, 1);
+	}
     }
 
   /* Update the fastmap now if not correct already.  */

--Multipart_Sun_Apr_13_11:42:53_1997-1--

