GNU bug report logs - #32201
27.0.50; setenv should not change match-data

Previous Next

Package: emacs;

Reported by: John Shahid <jvshahid <at> gmail.com>

Date: Wed, 18 Jul 2018 19:20:01 UTC

Severity: normal

Tags: fixed, patch

Found in version 27.0.50

Fixed in version 26.2

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


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

From: Noam Postavsky <npostavs <at> gmail.com>
To: John Shahid <jvshahid <at> gmail.com>
Cc: 32201 <at> debbugs.gnu.org
Subject: Re: bug#32201: 27.0.50; setenv should not change match-data
Date: Sat, 21 Jul 2018 21:30:02 -0400
tags 32201 fixed
close 32201 26.2
quit

Noam Postavsky <npostavs <at> gmail.com> writes:

> John Shahid <jvshahid <at> gmail.com> writes:
>
>>> Anyway, I don't think setenv should be changed, rather
>>> abbreviate-file-name should save-match-data around the expand-file-name
>>> call.  After all, today you happened to use setenv in a hook, tomorrow
>>> someone will use another match-data modifying function.
>>
>> I agree, but I also think that there is no reason for `setenv' to use
>> `string-match' instead of `string-match-p'.  It doesn't seem to be using
>> the match data anyway.  I attached the patch that replaces
>> `string-match' with `string-match-p' in `setenv' and `setenv-internal'.
>> WDYT ?
>
> Seems harmless enough.  I'll wait a couple of days, and then push my
> abbreviate-file-name patch to emacs-26 and this patch to master.

Done.

[1: 59e8533286]: 2018-07-21 21:07:07 -0400
  Add save-match-data to abbreviate-file-name (Bug#32201)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=59e8533286cc8b5abc80b0966ef4b9fb676fbdfe

[2: b7ca3d5d93]: 2018-07-21 21:10:20 -0400
  Avoid destroying match data in 'setenv' (Bug#32201)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=b7ca3d5d932bad6900296679ab87f7d0d64d1de9




This bug report was last modified 6 years and 307 days ago.

Previous Next


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