unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Phil Hagelberg <phil@hagelb.org>
Cc: 49918@debbugs.gnu.org
Subject: bug#49918: 28.0.50; cd function expands CDPATH incorrectly
Date: Sat, 07 Aug 2021 12:51:22 +0200	[thread overview]
Message-ID: <87wnox7ck5.fsf@gnus.org> (raw)
In-Reply-To: <87lf5eyrvx.fsf@hagelb.org> (Phil Hagelberg's message of "Fri, 06 Aug 2021 18:18:10 -0700")

Phil Hagelberg <phil@hagelb.org> writes:

> When using the function `cd' with a relative path and the $CDPATH
> environment variable set, it will expand the value of $CDPATH once and
> save off that expansion for future use. This causes all calls with
> relative paths to fail when run from a different directory.
>
> This reproduces the problem using eshell, but the bug affects any caller
> of the `cd' function, not just eshell. However, it does not affect M-x
> cd, which will always use absolute paths.
>
>     CDPATH=.:$HOME/src emacs -Q
>     M-x eshell
>     cd /
>     cd tmp
>     No such directory found via CDPATH environment variable: tmp
>
> 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.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





  reply	other threads:[~2021-08-07 10:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07  1:18 bug#49918: 28.0.50; cd function expands CDPATH incorrectly Phil Hagelberg
2021-08-07 10:51 ` Lars Ingebrigtsen [this message]
2021-08-07 12:17   ` Eli Zaretskii
2021-08-07 15:50     ` Phil Hagelberg
2021-08-08 12:42     ` Lars Ingebrigtsen
2021-08-08 14:32       ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wnox7ck5.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=49918@debbugs.gnu.org \
    --cc=phil@hagelb.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).