Tcl Source Code

Ticket Change Details
Login
Overview

Artifact ID: 6679ffa549f151a38dafeb2c4b14f88b9efa208e236475fbc982c0871550c52d
Ticket: e83a97c7fee9d6bc2bec78d70b205a0e4d09ea8d
windows: paths starting with tilde (~) are "partially" absolute
User & Date: sebres 2019-11-08 13:23:56
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    Issue could be considered as continuation of [9e6b569963]...
    
    Under windows it is possible to have relative paths (file and directory names) starting with tilde, as such it is "partially absolute" path, so in my opinion should be interpreted as relative if used in file join.<br/>
    From this point of view <code>file join $dirname $filename</code> behaves incorrectly under windows if <code>filename</code> starting with <code>~</code> characters:
    
    <code><pre style="padding-left:10pt">
    % file join $env(tmp) ~*
    ~*
    % file join $env(tmp) ~abc.txt
    ~abc.txt
    </pre></code>
    
    Where <code>glob</code> already has correct behavior here:
    <code><pre style="padding-left:10pt">
    % glob -directory e:/temp ~*
    e:/temp/~abc.txt
    % glob e:/temp/~*
    e:/temp/~abc.txt
    % cd e:/temp
    % glob [pwd]/~*
    E:/Temp/~abc.txt
    </pre></code>
    
    Just this one is a bit confusing (I know it is a bit "ambiguous", but...):
    <code><pre style="padding-left:10pt">
    % glob ~*
    user "*" doesn't exist
    </pre></code>
    Despite ambiguity it looks still weird to me:
    
    <ol>
    <li> either the decision remains "path of pattern is absolute", it could be fixed to list all users/homes where caller is permitted.</li>
    <li> or the decision going either to "path of pattern considered as relative" under windows, it should behave like <code>glob [pwd]/~*</code> (so find all files starting with "~" in current directory).</li>
    </ol>
    
    Anyway (after fix) it could be additionally documented (with difference between unix/windows).
    
  5. foundin changed to: "any"
  6. is_private changed to: "0"
  7. login: "sebres"
  8. priority changed to: "5 Medium"
  9. resolution changed to: "None"
  10. severity changed to: "Minor"
  11. status changed to: "Open"
  12. submitter changed to: "sebres"
  13. subsystem changed to: "36. Pathname Management"
  14. title changed to:
    windows: paths starting with tilde (~) are "partially" absolute
    
  15. type changed to: "Bug"