From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Richard Copley Newsgroups: gmane.emacs.bugs Subject: bug#57353: [PATCH] Fix parse-colon-path with UNC directory names Date: Wed, 24 Aug 2022 15:23:56 +0100 Message-ID: References: <83bksb859u.fsf@gnu.org> <83fshl682u.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18052"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57353@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 24 16:25:15 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 1oQrJi-0004Vn-RP for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Aug 2022 16:25:14 +0200 Original-Received: from localhost ([::1]:36748 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQrJg-0001zT-En for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Aug 2022 10:25:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQrJW-0001xA-N2 for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2022 10:25:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57862) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQrJW-0004D8-DT for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2022 10:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oQrJW-00075d-91 for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2022 10:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Richard Copley Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Aug 2022 14:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57353 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57353-submit@debbugs.gnu.org id=B57353.166135107127213 (code B ref 57353); Wed, 24 Aug 2022 14:25:02 +0000 Original-Received: (at 57353) by debbugs.gnu.org; 24 Aug 2022 14:24:31 +0000 Original-Received: from localhost ([127.0.0.1]:47611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQrJ0-00074p-Nj for submit@debbugs.gnu.org; Wed, 24 Aug 2022 10:24:30 -0400 Original-Received: from mail-ej1-f46.google.com ([209.85.218.46]:33574) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQrIy-00074b-4H for 57353@debbugs.gnu.org; Wed, 24 Aug 2022 10:24:29 -0400 Original-Received: by mail-ej1-f46.google.com with SMTP id j21so28449003ejs.0 for <57353@debbugs.gnu.org>; Wed, 24 Aug 2022 07:24:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=XDmj936pXfT1HOXMOOAkPXlmWZx12E4JjK5gUeJltKY=; b=BD5VNuDmbgkVm07w+Cam0B8j935r/XmSODOza82NLf53Dr29PTFhS6A1ZKAFjd1VhH 0kpDFdlBnU0UTHtezBbDweMCR2mux/c7spnyK5JIxlUcTSdZRcFhBjiHu7+G/SVCBgVs AweJQzQrUc4h+lKUEiCdZdEUBjLZZ1c1cbiYWSHO6VZNoY2AIF/oDPnfupDVfLiSRsd6 kKrbI0YIHLs4qniwcbo8aeHXueX1/2vbWzSCE6Qd+71xqpnjeH23XIBbqygPDyfkNVkf WuGtt3TXFaXt7llcTCag6DwZVvmLU9hwuJWIs7lZO21JtAFi1qANGCVE/Z13NE7ra4lb F5iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=XDmj936pXfT1HOXMOOAkPXlmWZx12E4JjK5gUeJltKY=; b=oZoB0gRIETw3WJ+U6iDuhBrQg2TR8D8TNpFGXxi+yTgM7RqLJjiJeW51EJ7cpbUvra 5TQoxioWAh9KUwoVMbhISZ4jjjIK7uCqtklUSZ8YqxqQ1TsDBmwqlIAEO0xFGqtQOVB4 I9J0EwE8YGYOYbCw+iOO5b4KS798NdCx+cVwPNE7sWOf8KNwiFc80CoSOT/XhucnCFBm 7yx7scFRIwq98QRPcwe7A/GBFCvHIqPXnY/3GxC3sNGUEtPiqbhLYeH8M9Dlc4Vx1gZh pbgTLADiidz7P3I0BeV2zGhPorxK8HMrRXYClE1y1HPmyZCTsmuhVBx9TnT8pPBYqANe akog== X-Gm-Message-State: ACgBeo3qRgbL4jwhO/X7fPJ+RMvP9l0T3TpPqtGmAYNPyo644HKe/R+Y AxOgV7fofFRMAqo09uQdY8PKCcZzhwJXukmQRkU= X-Google-Smtp-Source: AA6agR52eeWlkl0FAU5ZSp7+wtU3nRZckNbGRCsMhkyyzCqXxYz0fZXloSOgLg8iIva5GtMgoc1vjVSOlF1o7KouNBY= X-Received: by 2002:a17:907:3e81:b0:726:9615:d14d with SMTP id hs1-20020a1709073e8100b007269615d14dmr2916162ejc.517.1661351062310; Wed, 24 Aug 2022 07:24:22 -0700 (PDT) In-Reply-To: <83fshl682u.fsf@gnu.org> 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:240631 Archived-At: 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.