From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#49918: 28.0.50; cd function expands CDPATH incorrectly Date: Sat, 07 Aug 2021 15:17:18 +0300 Message-ID: <835ywhih4h.fsf@gnu.org> References: <87lf5eyrvx.fsf@hagelb.org> <87wnox7ck5.fsf@gnus.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30827"; mail-complaints-to="usenet@ciao.gmane.io" Cc: phil@hagelb.org, 49918@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Aug 07 14:18:16 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mCLHL-0007p7-Pr for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Aug 2021 14:18:15 +0200 Original-Received: from localhost ([::1]:57736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCLHK-0002YY-F4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Aug 2021 08:18:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCLH8-0002YN-KB for bug-gnu-emacs@gnu.org; Sat, 07 Aug 2021 08:18:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40583) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mCLH8-0007u9-Dn for bug-gnu-emacs@gnu.org; Sat, 07 Aug 2021 08:18:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mCLH8-0003Gc-8Z for bug-gnu-emacs@gnu.org; Sat, 07 Aug 2021 08:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Aug 2021 12:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49918 X-GNU-PR-Package: emacs Original-Received: via spool by 49918-submit@debbugs.gnu.org id=B49918.162833864612512 (code B ref 49918); Sat, 07 Aug 2021 12:18:02 +0000 Original-Received: (at 49918) by debbugs.gnu.org; 7 Aug 2021 12:17:26 +0000 Original-Received: from localhost ([127.0.0.1]:52129 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCLGY-0003Fk-IA for submit@debbugs.gnu.org; Sat, 07 Aug 2021 08:17:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:40308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCLGV-0003FW-9A for 49918@debbugs.gnu.org; Sat, 07 Aug 2021 08:17:25 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:53422) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mCLGP-0007MT-H0; Sat, 07 Aug 2021 08:17:17 -0400 Original-Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2381 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mCLGP-0003ed-3k; Sat, 07 Aug 2021 08:17:17 -0400 In-Reply-To: <87wnox7ck5.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat, 07 Aug 2021 12:51:22 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:211377 Archived-At: > From: Lars Ingebrigtsen > Date: Sat, 07 Aug 2021 12:51:22 +0200 > Cc: 49918@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. 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?