]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't infloop in comint-redirect-results-list-from-process
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 19 Jan 2021 04:13:03 +0000 (05:13 +0100)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 19 Jan 2021 04:13:03 +0000 (05:13 +0100)
* lisp/comint.el (comint-redirect-results-list-from-process):
Ensure forward progress (bug#45950).

lisp/comint.el

index 53153af7d27ef8fe82623f0239c5c8b319c23652..e52d67d0e50d56feda7ad674312c15829980fc67 100644 (file)
@@ -3863,7 +3863,11 @@ REGEXP-GROUP is the regular expression group in REGEXP to use."
        (push (buffer-substring-no-properties
                (match-beginning regexp-group)
                (match-end regexp-group))
-              results))
+              results)
+        (when (zerop (length (match-string 0)))
+          ;; If the regexp can be empty (for instance, "^.*$"), we
+          ;; don't advance, so ensure forward progress.
+         (forward-line 1)))
       (nreverse results))))
 \f
 ;; Converting process modes to use comint mode