Skip to content
Tcl Source Code View Ticket
Login

View Ticket

Inconsistent handling of leading //

Closed / Fixedf9fe90d0fa28fbe821db1c207de34010d51cf6e8Created 10 years agoUpdated 10 years ago
Descriptionplain2016-12-16 05:30:04
(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].
Referenced by4
rkeeneplain2016-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
dgp Ticket [f9fe90d0fa]: 3 changes [History diff]2017-01-03 19:45:13
aspectwiki2017-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]).

dgpplain2017-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.
dgpplain2017-05-01 20:24:35
Fix for all dev branches.
Log in (anonymous is fine) to add a comment.