diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2021-01-19 05:13:03 +0100 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2021-01-19 05:13:03 +0100 |
commit | 43982a8f1017f709f78d5722796c266d4f72de05 (patch) | |
tree | 85311c6525ce73a4f5e5347682c224e0285ac368 | |
parent | 973799f17996c99f500024f35604d49b70ce4439 (diff) | |
download | emacs-43982a8f1017f709f78d5722796c266d4f72de05.tar.gz |
Don't infloop in comint-redirect-results-list-from-process
* lisp/comint.el (comint-redirect-results-list-from-process):
Ensure forward progress (bug#45950).
-rw-r--r-- | lisp/comint.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/comint.el b/lisp/comint.el index 53153af7d27..e52d67d0e50 100644 --- a/lisp/comint.el +++ b/lisp/comint.el @@ -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)))) ;; Converting process modes to use comint mode |