GNU bug report logs - #57353
[PATCH] Fix parse-colon-path with UNC directory names

Previous Next

Package: emacs;

Reported by: Richard Copley <rcopley <at> gmail.com>

Date: Tue, 23 Aug 2022 11:35:01 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 57353 <at> debbugs.gnu.org (full text, mbox):

From: Richard Copley <rcopley <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 57353 <at> debbugs.gnu.org
Subject: Re: bug#57353: [PATCH] Fix parse-colon-path with UNC directory names
Date: Wed, 24 Aug 2022 15:23:56 +0100
On Wed, 24 Aug 2022 at 15:15, Eli Zaretskii <eliz <at> gnu.org> 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.




This bug report was last modified 2 years and 271 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.