]> code.delx.au - gnu-emacs/commitdiff
* replace.el (occur-engine): Avoid infloop.
authorChong Yidong <cyd@gnu.org>
Wed, 18 Dec 2013 05:10:58 +0000 (13:10 +0800)
committerChong Yidong <cyd@gnu.org>
Wed, 18 Dec 2013 05:10:58 +0000 (13:10 +0800)
Fixes: debbugs:7593
lisp/ChangeLog
lisp/replace.el

index aef7eb5cc5bd37692639f72e3650da731558c5ed..e106a763332ccfeac33b87929219ecab4c9737f6 100644 (file)
@@ -1,3 +1,7 @@
+2013-12-18  Chong Yidong  <cyd@gnu.org>
+
+       * replace.el (occur-engine): Avoid infloop (Bug#7593).
+
 2013-12-18  Kazuhiro Ito  <kzhr@d1.dion.ne.jp>  (tiny change)
 
        * progmodes/make-mode.el (makefile-fill-paragraph): Fix infloop
index 061300c782989528f723a4669d3223be2b1eabd8..2c6b02364b2ec5a7d3a8d5d7827bf578a7731e02 100644 (file)
@@ -1457,7 +1457,9 @@ See also `multi-occur'."
                            ;; so as to override faces copied from the buffer.
                            `(face ,match-face)))
                         curstring)
-                       (setq start (match-end 0))))
+                       ;; Avoid infloop (Bug#7593).
+                       (let ((end (match-end 0)))
+                         (setq start (if (= start end) (1+ start) end)))))
                    ;; Generate the string to insert for this match
                    (let* ((match-prefix
                            ;; Using 7 digits aligns tabs properly.