Subject: bug#49918: 28.0.50; cd function expands CDPATH incorrectly

From: Eli Zaretskii <[email-masked]>
Date: Sat, 07 Aug 2021 15:17:18 +0300

> From: Lars Ingebrigtsen <[email-masked]>
> Date: Sat, 07 Aug 2021 12:51:22 +0200
> Cc: [email-masked]
> 
> > 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.

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?