View Ticket
Not logged in
Ticket UUID: f9fe90d0fa28fbe821db1c207de34010d51cf6e8
Title: Inconsistent handling of leading //
Type: Bug Version: 8.6.5
Submitter: aspect Created on: 2016-12-16 05:30:04
Subsystem: 36. Pathname Management Assigned To: dgp
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2017-05-01 20:24:35
Resolution: Fixed Closed By: dgp
    Closed on: 2017-05-01 20:24:35
Description:
(on Unix - no idea about Windows)

% file join //bla a
/bla/a
% file normalize //bla
//bla
% file join //bla a
//bla/a

From [::tcl::unsupported::representation] we can see what's going on - the 2nd line shimmers interned //bla to a path.

Proper UNC paths should have a trailing slash .. but then it gets even weirder:

% file join //bla/ a
/bla/a
% file normalize //bla/
/bla
% file join //bla/ a
//bla/a

Handling of //-prefixed paths seems to be inconsistent.  I *think* they're documented as special only on Windows (UNC paths), but there's code somewhere treating them specially on Unix.  It's not in TclFSNormalizeAbsolutePath.

There's an argument that treating them specially on Unix would be useful, if only as pseudo-mountpoints for VFS.

See also [bug 1752589fff].
User Comments: dgp added on 2017-05-01 20:24:35:
Fix for all dev branches.

dgp added on 2017-05-01 16:12:44:
If someone wants to make // prefix special, they
should mount a Tcl_Filesystem that does so.

The "native" filesystem for unix should not be changed
in this way.

aspect added on 2017-04-29 11:05:52:

The fix for [f34cf83dd0] (merged to trunk in [e895b53905]) came close to hitting this.

Attempted fix in [bug-f9fe90d0fa] ([27bac5b2c6]).


rkeene added on 2016-12-16 15:38:26:
// is specified by POSIX to be special:

> A pathname that begins with two successive slashes may be interpreted in an 
> implementation-defined manner, although more than two leading slashes shall be 
> treated as a single slash.

http://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap04.html#tag_04_11