Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2017-05-01
20:25
[f9fe90d0fa] [file join] normalization. See filesystem-1.52* check-in: a8e5699f86 user: dgp tags: trunk
20:25
[f9fe90d0fa] [file join] normalization. See filesystem-1.52* check-in: c66a1bfbd9 user: dgp tags: core-8-6-branch
20:24 • Closed ticket [f9fe90d0fa]: Inconsistent handling of leading // plus 6 other... artifact: 2bc6e6938b user: dgp
20:23
[f9fe90d0fa] [file join] normalization. See filesystem-1.52* check-in: 650c12161a user: dgp tags: core-8-5-branch
16:12 • Ticket [f9fe90d0fa] Inconsistent handling of leading // status still Open wi... artifact: 846c9e24c9 user: dgp
2017-04-29
11:05 • Ticket [f9fe90d0fa]: 3 changes artifact: 36ecfc49e7 user: aspect
11:04
[f9fe90d0fa]: more path normalization in TclNewFSPathObj leaf check-in: 27bac5b2c6 user: aspect tags: bug-f9fe90d0fa
2017-01-03
19:45 • Ticket [f9fe90d0fa] Inconsistent handling of leading // status still Open wi... artifact: a2835be349 user: dgp
2016-12-16
15:38 • Ticket [f9fe90d0fa]: 4 changes artifact: b0b089ef04 user: rkeene
05:30 • New ticket [f9fe90d0fa]. artifact: 2e1e63bcbe user: aspect

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.