GNU bug report logs - #57102
29.0.50; Peculiar file-name-split edge case

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Wed, 10 Aug 2022 08:26:02 UTC

Severity: normal

Found in version 29.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: philipk <at> posteo.net, 57102 <at> debbugs.gnu.org
Subject: bug#57102: 29.0.50; Peculiar file-name-split edge case
Date: Mon, 15 Aug 2022 14:35:28 +0300
> Cc: 57102 <at> debbugs.gnu.org
> From: Lars Ingebrigtsen <larsi <at> gnus.org>
> Date: Mon, 15 Aug 2022 07:54:34 +0200
> 
> That is, perhaps what we want is
> 
> (file-name-split "a/b")
> => '("a" "b")
> 
> (file-name-split "a/b/")
> => '("a" "b")
> 
> (file-name-split "/a/b")
> => '("a" "b")

This should return '("/" "a" "b"), or '("/a" "b")  I think.

> (file-name-split "//a////b////")
> => '("a" "b")

And this should return '("/" "a" "b" "/"), or '("/a" "b/").

> I'm not sure what
> 
> (file-name-split "c:/a/b")
> 
> on Windows should return in that case, though.

If you agree with the above, then '("c:/" "a" "b").

If you don't care about the root directory, then '("a" "b")
(a.k.a. "leave the interpretation to the caller").




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

Previous Next


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