GNU bug report logs - #54218
[PATCH] Magic number regexp shouldn't match beyond end-of-line.

Previous Next

Package: emacs;

Reported by: "Andrew L. Moore" <slewsys <at> gmail.com>

Date: Wed, 2 Mar 2022 04:53:01 UTC

Severity: normal

Tags: patch

Fixed in version 29.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 54218 <at> debbugs.gnu.org (full text, mbox):

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: "Andrew L. Moore" <slewsys <at> gmail.com>
Cc: 54218 <at> debbugs.gnu.org
Subject: Re: bug#54218: [PATCH] Magic number regexp shouldn't match beyond
 end-of-line.
Date: Wed, 02 Mar 2022 09:23:55 +0100
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 <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




This bug report was last modified 3 years and 77 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.