[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#54218: [PATCH] Magic number regexp shouldn't match beyond end-of-lin
From: |
Andreas Schwab |
Subject: |
bug#54218: [PATCH] Magic number regexp shouldn't match beyond end-of-line. |
Date: |
Wed, 02 Mar 2022 09:23:55 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.91 (gnu/linux) |
On Mär 01 2022, Andrew L. Moore wrote:
> diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el
> index d7c093444e..9116bdea9d 100644
> --- a/lisp/progmodes/executable.el
> +++ b/lisp/progmodes/executable.el
> @@ -232,7 +232,8 @@ executable-set-magic
> (save-excursion
> (goto-char (point-min))
> (add-hook 'after-save-hook 'executable-chmod nil t)
> - (if (looking-at "#![ \t]*\\(.*\\)$")
> + ;; Regexp shouldn't match beyond end-of-line.
> + (if (looking-at "#![ \t]*\\([^\n]*\\)$")
In Emacs regexps, `.' doesn't match newlines.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510 2552 DF73 E780 A9DA AEC1
"And now for something completely different."