(gnus-sieve-generate): Rewrite regexp search so it
authorSimon Josefsson <jas@extundo.com>
Wed, 23 Apr 2003 19:53:05 +0000 (19:53 +0000)
committerSimon Josefsson <jas@extundo.com>
Wed, 23 Apr 2003 19:53:05 +0000 (19:53 +0000)
doesn't exceed the regexp stack space.

lisp/ChangeLog
lisp/gnus-sieve.el

index a25e0b0..e9b06d5 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-23  Simon Josefsson  <jas@extundo.com>
+
+       * gnus-sieve.el (gnus-sieve-generate): Rewrite regexp search so it
+       doesn't exceed the regexp stack space.
+
 2003-04-23  Jesper Harder  <harder@ifa.au.dk>
 
        * gnus-msg.el (gnus-inews-mark-gcc-as-read): Don't defvar it.
index d8133a7..b11ade5 100644 (file)
@@ -105,10 +105,11 @@ See the documentation for these variables and functions for details."
   (require 'sieve)
   (find-file gnus-sieve-file)
   (goto-char (point-min))
-  (if (re-search-forward
-       (concat (regexp-quote gnus-sieve-region-start) "\\(.\\|\n\\)*"
-              (regexp-quote gnus-sieve-region-end)) nil t)
-      (delete-region (match-beginning 0) (match-end 0))
+  (if (re-search-forward (regexp-quote gnus-sieve-region-start) nil t)
+      (delete-region (match-end 0)
+                    (or (re-search-forward (regexp-quote
+                                            gnus-sieve-region-end) nil t)
+                        (point)))
     (insert sieve-template))
   (insert gnus-sieve-region-start
          (gnus-sieve-script gnus-sieve-select-method gnus-sieve-crosspost)