Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-21
10:03 • Closed ticket [1752589fff]: file normalize misses two leading / on first level c... artifact: 7c88980794 user: serhiy.storchaka
2018-07-27
17:15 • Open ticket [baf4387372]: file join trashes valid network paths plus 5 other... artifact: 1f8fa30714 user: sebres
11:03 • Ticket [baf4387372]: 4 changes artifact: 0895787e36 user: sebres
2017-05-06
12:52 • Ticket [f34cf83dd0] unexpected result for "file normalize" status ... artifact: 5fd31b4724 user: gustafn2
2017-04-29
11:05 • Ticket [f9fe90d0fa] Inconsistent handling of leading // status still Open wi... artifact: 36ecfc49e7 user: aspect
2017-04-28
17:59 • Closed ticket [f34cf83dd0]: unexpected result for "file normalize"... artifact: 349624ae02 user: dgp
17:57
[f34cf83dd0] An optimization was being taken in a case where it produced the wrong result, failing t... check-in: e895b53905 user: dgp tags: trunk
17:52
[f34cf83dd0] An optimization was being taken in a case where it produced the wrong result, failing t... check-in: e015bfe72f user: dgp tags: core-8-6-branch
17:49
[f34cf83dd0] An optimization was being taken in a case where it produced the wrong result, failing t... check-in: 2158eea530 user: dgp tags: core-8-5-branch
17:46
Test for [f34cf83dd0]. check-in: 769ae9c349 user: dgp tags: trunk
17:44
Test for [f34cf83dd0]. check-in: 9a6ff36832 user: dgp tags: core-8-6-branch
17:43
Test for [f34cf83dd0]. check-in: f49a421a0d user: dgp tags: core-8-5-branch
16:41 • Ticket [f34cf83dd0] unexpected result for "file normalize" status ... artifact: 4e32e0a76b user: dgp
2017-04-27
14:29 • Ticket [f34cf83dd0]: 3 changes artifact: 7cf119cf6c user: dgp
2017-04-25
09:48 • New ticket [f34cf83dd0]. artifact: 8d0a46fb2f user: gustafn2

unexpected result for "file normalize"

Closed / Fixedf34cf83dd0150cbbea33469d70a6a400559979c1Created 10 years agoUpdated 10 years ago
Descriptionplain2017-04-25 09:48:09
Two slashes in paths are only sometimes reduced to a single slash. This inconsistent behavior contradicts the aim that "file normalize" returns 'the “standard” format for the native platform'. 

This is seen at least with tcl 8.6.6 and Tcl 8.7a0 on MacOS X and Linux.

   % file normalize //foo
   //foo
   % file normalize //foo/
   /foo
   % file normalize ///foo
   /foo
   % file normalize /foo//bar
   /foo/bar
   % file normalize //foo/bar
   //foo/bar
   % file normalize //foo//bar
   /foo/bar
   % file normalize //foo/bar/
   /foo/bar

   % set tcl_patchLevel
   8.6.6
Referenced by10
  • 7c88980794Closed ticket [1752589fff]: file normalize misses two leading / on first level catalog plus 4 other changes ticket2026-10-21 10:03:39
  • 1f8fa30714Open ticket [baf4387372]: file join trashes valid network paths plus 5 other changes ticket2018-07-27 17:15:44
  • 0895787e36Ticket [baf4387372] file join trashes valid network paths status still Open with 4 other changes ticket2018-07-27 11:03:10
  • 36ecfc49e7Ticket [f9fe90d0fa] Inconsistent handling of leading // status still Open with 3 other changes ticket2017-04-29 11:05:52
  • e895b53905[f34cf83dd0] An optimization was being taken in a case where it produced the wrong result, failing to collapse multiple /// into /. Testing on Windows where path expectations may vary would be a good idea, but since this is just an optimization avoidance, I suspect we're ok. check-in2017-04-28 17:57:34
  • e015bfe72f[f34cf83dd0] An optimization was being taken in a case where it produced the wrong result, failing to collapse multiple /// into /. Testing on Windows where path expectations may vary would be a good idea, but since this is just an optimization avoidance, I suspect we're ok. check-in2017-04-28 17:52:26
  • 2158eea530[f34cf83dd0] An optimization was being taken in a case where it produced the wrong result, failing to collapse multiple /// into /. Testing on Windows where path expectations may vary would be a good idea, but since this is just an optimization avoidance, I suspect we're ok. check-in2017-04-28 17:49:43
  • 769ae9c349Test for [f34cf83dd0]. check-in2017-04-28 17:46:11
  • 9a6ff36832Test for [f34cf83dd0]. check-in2017-04-28 17:44:31
  • f49a421a0dTest for [f34cf83dd0]. check-in2017-04-28 17:43:49
dgpplain2017-04-27 14:29:53
Bisecting points the blame at

https://core.tcl.tk/tcl/info/9cfcca63fb0
dgpplain2017-04-28 16:41:03
It appears this traces down to a flaw in [file join]
machinery:

% info patch
8.4.20
% file join foo /bar
/bar
%  file join foo //bar
/bar
%  file join foo ///bar
/bar

% info patch
8.6.6
% file join foo /bar
/bar
% file join foo //bar
//bar
% file join foo ///bar
/bar
dgpplain2017-04-28 17:59:43
Fixed on all dev branches
gustafn2plain2017-05-06 12:52:37
Great, Many thanks!
Log in (anonymous is fine) to add a comment.