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#57353: [PATCH] Fix parse-colon-path with UNC directory names Date: Wed, 24 Aug 2022 19:21:47 +0300 Message-ID: <835yih6290.fsf@gnu.org> References: <83bksb859u.fsf@gnu.org> <83fshl682u.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25613"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57353-done@debbugs.gnu.org To: Richard Copley Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 24 18:32:30 2022 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 1oQtIs-0006VT-5V for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Aug 2022 18:32:30 +0200 Original-Received: from localhost ([::1]:52452 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQtIr-0001D7-2u for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Aug 2022 12:32:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQt8k-0005tb-Gw for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2022 12:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQt8k-0008QZ-7n for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2022 12:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oQt8k-0001rQ-3h for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2022 12:22:02 -0400 Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Aug 2022 16:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 57353 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 57353@debbugs.gnu.org, eliz@gnu.org, rcopley@gmail.com Original-Received: via spool by 57353-done@debbugs.gnu.org id=D57353.16613581117133 (code D ref 57353); Wed, 24 Aug 2022 16:22:01 +0000 Original-Received: (at 57353-done) by debbugs.gnu.org; 24 Aug 2022 16:21:51 +0000 Original-Received: from localhost ([127.0.0.1]:47940 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQt8Y-0001qy-N1 for submit@debbugs.gnu.org; Wed, 24 Aug 2022 12:21:51 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQt8X-0001qn-Dz for 57353-done@debbugs.gnu.org; Wed, 24 Aug 2022 12:21:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50298) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQt8Q-0008Jc-D5; Wed, 24 Aug 2022 12:21:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=rKA9xvWTDMGc5+ABjRdCr6TjvXgovKDp+0jBxkW3eGA=; b=Lyj9ttlLad40 Vgjb4+zruBNAb8HEy58kZZpGgcVRrjl314LEXRFIFxD5blbRXucWIzEK8h/y2ei20GcQnXegY/mF0 delYASg/kW0IlakkGXIrQmPOsL8722f45+IHbNl4VOcLHrDdnxTz8qOx/N7Nr79I/Sx92lUTCgPOS otbNHw/layHuAj12EYzhAQ5aoW/SjBCF6fqa9oKoKUlRK1RusBbJriVfYBs+Ny2Ra2sUFW9PjNegG wgbGOcDogdbtUxlNXXG4MmOVl5sybNb4S0o4p16P6qcsgjfyXQLwHUoZtccw8rVshRslIFgXGn68b rIHou86W2ArlnGdWJdTufw==; Original-Received: from [87.69.77.57] (port=3228 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 1oQt8M-0006wq-7k; Wed, 24 Aug 2022 12:21:40 -0400 In-Reply-To: (message from Richard Copley on Wed, 24 Aug 2022 15:23:56 +0100) 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:240644 Archived-At: > From: Richard Copley > Date: Wed, 24 Aug 2022 15:23:56 +0100 > Cc: 57353@debbugs.gnu.org > > On Wed, 24 Aug 2022 at 15:15, Eli Zaretskii wrote: > > > > Does the patch below give good results in your use cases? > > > > diff --git a/lisp/files.el b/lisp/files.el > > index 8596d9a..26730df 100644 > > --- a/lisp/files.el > > +++ b/lisp/files.el > > @@ -856,10 +856,16 @@ parse-colon-path > > (if (equal "" f) nil > > (let ((dir (file-name-as-directory f))) > > ;; Previous implementation used `substitute-in-file-name' > > - ;; which collapse multiple "/" in front. Do the same for > > - ;; backward compatibility. > > - (if (string-match "\\`/+" dir) > > - (substring dir (1- (match-end 0))) dir)))) > > + ;; which collapses multiple "/" in front, while > > + ;; preserving double slash where it matters. Do > > + ;; the same for backward compatibility. > > + (if (string-match "\\`//+" dir) > > + (substring dir > > + (- (match-end 0) > > + (if (memq system-type > > + '(windows-nt 'cygwin 'ms-dos)) > > + 2 1))) > > + dir)))) > > (split-string spath path-separator))))) > > > > (defun cd-absolute (dir) > > It does. Thanks, installed with minor changes, and closing the bug.