emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/multiple-cursors 5e879f9 261/434: Guard against empty sear


From: ELPA Syncer
Subject: [nongnu] elpa/multiple-cursors 5e879f9 261/434: Guard against empty search pattern in 'mc/mark-all-in-region', otherwise it will enter an infinite loop
Date: Sat, 7 Aug 2021 09:20:38 -0400 (EDT)

branch: elpa/multiple-cursors
commit 5e879f9b5cb5785fe266435b45333fd002d2dc05
Author: Maciej Katafiasz <mathrick@gmail.com>
Commit: Maciej Katafiasz <mathrick@gmail.com>

    Guard against empty search pattern in 'mc/mark-all-in-region', otherwise it 
will enter an infinite loop
---
 mc-mark-more.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]