GNU bug report logs -
#49918
28.0.50; cd function expands CDPATH incorrectly
Previous Next
Reported by: Phil Hagelberg <phil <at> hagelb.org>
Date: Sat, 7 Aug 2021 01:19:01 UTC
Severity: normal
Found in version 28.0.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Eli Zaretskii <eliz <at> gnu.org> writes:
>> From: Lars Ingebrigtsen <larsi <at> gnus.org>
>> Date: Sat, 07 Aug 2021 12:51:22 +0200
>> Cc: 49918 <at> debbugs.gnu.org
>>
>> > This happens because of this snippet inside the `cd' function:
>> >
>> > (unless cd-path
>> > (setq cd-path (or (parse-colon-path (getenv "CDPATH"))
>> > (list "./"))))
>>
>> Yup. Thanks for the detailed analysis.
>>
>> This should now be fixed in Emacs 28.
Thanks for the fix! I can confirm it does solve the problem.
> Why does the current implementation of parse-colon-path use
> expand-file-name? The comment says "to expand "~", but the original
> implementation in Emacs 27 didn't do that.
>
> Bug#21454 only wanted to avoid mis-interpreting duplicate slashes in
> the input path, but there's no need to collapse them, so I don't see
> how the call to expand-file-name is at all necessary, and could
> potentially change behavior in unintended ways. Am I missing
> something?
I have to agree I don't understand the logic of the patch that added the
`expand-file-name' call. It doesn't seem related to the bug it was
intended to fix. It's certainly not necessary from the context of
`parse-colon-path' being called from `cd' but I didn't take the time to
examine other callers to see if it would be relevant from those
contexts. But it's not unreasonable to assume that expansion should
happen downstream of the call to `parse-colon-path'.
-Phil
[signature.asc (application/pgp-signature, inline)]
This bug report was last modified 3 years and 289 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.