Guard against empty search pattern in 'mc/mark-all-in-region', otherwise it will enter an infinite loop

This commit is contained in:
Maciej Katafiasz 2013-09-05 17:36:47 +02:00
parent 186cb3b63f
commit 5e879f9b5c

View File

@ -270,7 +270,8 @@ With zero ARG, skip the last one and mark next."
(case-fold-search nil)) (case-fold-search nil))
(mc/remove-fake-cursors) (mc/remove-fake-cursors)
(goto-char beg) (goto-char beg)
(while (search-forward search end t) (while (and (not (string= search ""))
(search-forward search end t))
(push-mark (match-beginning 0)) (push-mark (match-beginning 0))
(mc/create-fake-cursor-at-point)) (mc/create-fake-cursor-at-point))
(let ((first (mc/furthest-cursor-before-point))) (let ((first (mc/furthest-cursor-before-point)))