Subject: bug#45950: 27.1; Certain regexps can cause comint-redirect-results-list-from-process to loop.

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 19 Jan 2021 05:16:02 +0100

Richard Sharman <[email-masked]> writes:

> Sorry, there was a mistake on the patch on my previous message; 
> the (re-search-forward regexp nil t)) was inadvertently changed to
> (re-search-forward regexp nil).
>
> Sorry.
>
> Here’s the corrected version:

[...]

> + (if (equal (point) last-point)
> +    (forward-line 1)
> +  (push (buffer-substring-no-properties
> + (match-beginning regexp-group)
> + (match-end regexp-group))
> + results))
> + (setq last-point (point)))
>        (nreverse results))))

I can reproduce the infloop in Emacs 28, but I don't think this is quite
the correct fix -- if you've asked for "^.*$", then you should get an
empty string in the result set, and not just "a" "b" "d".  So I've
installed a variant of what you suggest in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no