* replace.el (occur-engine): Avoid infloop.
[bpt/emacs.git] / lisp / replace.el
index 061300c..2c6b023 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.