git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Handle double slashes in make_relative_path()

From
Thomas Rast <trast@student.ethz.ch>
Date
Jan 24, 2010, 13:57 UTC
Message-ID
<201001241457.43297.trast@student.ethz.ch>
In-Reply-To
<fabb9a1e1001231301o149bb13es236a7150f57ce161@mail.gmail.com>
On Saturday 23 January 2010 22:01:38 Sverre Rabbelier wrote:
Show 11 quoted lines
> Heya,
> 
> On Sat, Jan 23, 2010 at 21:41, Johannes Sixt <j6t@kdbg.org> wrote:
> 
> > OTOH, it can be worked around easily by the user (just insert the drive
> > prefix). Dunno...
> 
> I think it's preferable to keep the old behavior where we fail if the
> user gives us an invalid argument, rather than fix a user error and
> break on a a valid argument instead. I think we should be correct
> first, and try and fix incorrect user behavior after.

I can't really comment on the Windows side of things, but I tried to come up with some more data points.

POSIX specifies that multiple slashes must be treated as if they were a single slash (except as in the next bullet point). Leading _double_ slashes may be treated implementation-dependently. [1] Non-leading double slashes do not seem to be specified.

There's a manpage path_resolution(7) on my system, which can also be found on the web quite easily, e.g. [2]. It doesn't say anything about multiple slashes, but experimentally my Linux resolves them as if they were single slashes (even a leading double slash).

Junio's patch is already in maint, so I suppose we're in the somewhat unfortunate situation where the old version didn't work in all cases on Linux, but the current one breaks on Windows in some cases. Then again, shouldn't windows get special support to figure out that /c/foo [3] is a prefix of /foo and vice versa, assuming you're currently in C:?

[1] http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11 Actually the server doesn't work for me, but google has a cached copy: http://209.85.129.132/search?q=cache:QUuajH7Dp5gJ:www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html+http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11&cd=1&hl=en&ct=clnk&gl=uk

[2] http://www.kernel.org/doc/man-pages/online/pages/man7/path_resolution.7.html

[3] Don't blame me if I didn't get that syntax right, I'm actively trying to forget I ever used Windows and it shows.

-- 
Thomas Rast
trast@{inf,student}.ethz.ch
Previous: Sverre RabbelierNext: Bernhard R. Link
Message 13 of 20 in “Handle double slashes in make_relative_path()”
  1. Handle double slashes in make_relative_path()Thomas Rast, Jan 22, 2010
  2. Junio C HamanoJan 22, 2010
  3. Junio C HamanoJan 22, 2010
  4. Johannes SixtJan 22, 2010
  5. Robin RosenbergJan 23, 2010
  6. Johannes SixtJan 23, 2010
  7. Robin RosenbergJan 23, 2010
  8. Johannes SixtJan 23, 2010
  9. Junio C HamanoJan 23, 2010
  10. Junio C HamanoJan 23, 2010
  11. Johannes SixtJan 23, 2010
  12. Sverre RabbelierJan 23, 2010
  13. Thomas RastJan 24, 2010
  14. Bernhard R. LinkJan 24, 2010
  15. Junio C HamanoJan 24, 2010
  16. Johannes SixtJan 24, 2010
  17. Junio C HamanoJan 24, 2010
  18. Robin RosenbergJan 25, 2010
  19. Thomas RastJan 22, 2010
  20. Junio C HamanoJan 22, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.