From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id 4b006dd6 for ; Sat, 1 Feb 2020 02:16:23 +0000 (UTC) Received: (qmail 5455 invoked by alias); 1 Feb 2020 02:16:16 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: List-Unsubscribe: X-Seq: 45367 Received: (qmail 1529 invoked by uid 1010); 1 Feb 2020 02:16:16 -0000 X-Qmail-Scanner-Diagnostics: from kahlil.inlv.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.1/25703. spamassassin: 3.4.2. Clear:RC:0(37.59.109.123):SA:0(-1.9/5.0):. Processed in 4.884432 secs); 01 Feb 2020 02:16:16 -0000 X-Envelope-From: martijn@inlv.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at inlv.org does not designate permitted sender hosts) To: Zsh hackers list From: Martijn Dekker Subject: [BUG] 'cd -P' leaves double slash in $PWD Message-ID: <963eb2c3-e6e6-15e9-9c3a-964b49c6b2c0@inlv.org> Date: Sat, 1 Feb 2020 03:15:31 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.4.2 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit $ zsh -c 'cd -P ////dev//; echo $PWD' //dev Expected output: /dev A double initial slash in a canonicalised/normalised path is okay if the original started with a double slash (as this could signify a Cygwin UNC network path), but not if it started with one or more than two slashes. Bug confirmed on zsh from current back to 5.0.8 (I didn't test earlier versions). -- modernish -- harness the shell https://github.com/modernish/modernish