Skip to content
Tcl Source Code History Of Ticket 879555ffffffffff
Login

History Of Ticket 879555ffffffffff

Artifacts Associated With Ticket 879555ffffffffff

  1. Ticket change [419a833260] (rid 116221) by coldstore on 2004-01-19 01:09:05:

    1. assignee initialized to: "vincentdarley"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      
      Assuming a directory htdocs as the current directory
      containing a file .tml, the following occurs:
      
      % puts $tcl_version
      8.5
      % puts $tcl_patchLevel
      8.5a0
      % glob .tml
      .tml
      % glob ./.tml
      no files matched glob pattern "./.tml"
      % glob [pwd]/.tml
      /home/colin/.gnome-desktop/tclhttpd-cvs/htdocs/.tml
      % glob ../htdocs/.tml
      no files matched glob pattern "../htdocs/.tml"
      
      This behavior is confusing and inconsistent, and
      doesn't seem to accord with the documentation (because
      it seems to be triggered by relative paths and not
      absolute paths.)
      
      
    4. foundin initialized to: "obsolete: 8.5a0"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "coldstore"
    9. subsystem initialized to: "37. File System"
    10. title initialized to: "unix glob has inconsistent behavior"
    11. type initialized to: "Bug"
  2. Ticket change [99edce3f83] (rid 110875) by vincentdarley on 2004-01-19 18:18:46:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      All of these work for me on Windows:
      
      % pwd
      C:/Documents and Settings/VinceD
      (VinceD) 2 % glob *
      .eclipse-platform .tkchatrc Alpha-v8 {Bluetooth Software}
      Cookies Desktop Favorites gsview32.ini {My Documents}
      PUTTY.RND {Start Menu} tmp UserData WINDOWS
      (VinceD) 3 % glob .tkchatrc
      .tkchatrc
      (VinceD) 4 % glob ./.tkchatrc
      ./.tkchatrc
      (VinceD) 5 % glob [pwd]/.tkchatrc
      {C:/Documents and Settings/VinceD/.tkchatrc}
      (VinceD) 6 % glob ../VinceD/.tkchatrc
      ../VinceD/.tkchatrc
      (VinceD) 7 % 
      
      So it must be something in the unix-specific code.  Note
      that the code path used here will be 'pattern == NULL' path,
      I think.
      
      This means the bug (or at least some very good information
      about the bug) should be in these few lines:
      
          if (pattern == NULL || (*pattern == '\0')) {
      /* Match a file directly */
      native = (CONST char*) Tcl_FSGetNativePath(pathPtr);
      if (NativeMatchType(native, types)) {
          Tcl_ListObjAppendElement(interp, resultPtr, pathPtr);
      }
      Tcl_DecrRefCount(fileNamePtr);
      return TCL_OK;
      
      in tclUnixFile.c/TclpMatchInDirectory.
      
      Since I'm not on unix, can I ask you to debug what is going
      on there?  In particular, what is 'native' in these cases?
      
      
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  3. Ticket change [4fa8db36c7] (rid 125860) by coldstore on 2004-01-19 23:13:47:

    1. icomment:
      Logged In: YES 
      user_id=19214
      
      Ok, Vince, I'm happy to debug it.  I'll get back to you in a
      few days with what I found - thanks for the localisation of
      the problem.
      
      
    2. login: "coldstore"
    3. mimetype: "text/plain"
    4. username: "coldstore"
  4. Ticket change [320a7d37c3] (rid 93541) by coldstore on 2004-01-22 11:54:57:

    1. icomment:
      Logged In: YES 
      user_id=19214
      
      The problem is in tclPathObj.c TclFSNormalizeAbsolutePath.
      Given a pathPtr argument containing the string
      "/home/colin/.gnome-desktop/tclhttpd-cvs/htdocs/./.tml" it
      returns a value
      "/home/colin/.gnome-desktop/tclhttpd-cvs/htdocs/htdocs/./.tml"
      
      The problem seems to be in the replacement of substrings
      like /./, where oldDirSep is not being advanced to account
      for the elision.
      
      Is the problem's solution immediately obvious, or should I
      go digging for one?  I don't feel I can suggest a solution
      off the top of my head, but I will certainly find one if needed.
      
      
    2. login: "coldstore"
    3. mimetype: "text/plain"
    4. username: "coldstore"
  5. Ticket change [3b27e8d282] (rid 112676) by vincentdarley on 2004-01-22 17:44:18:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      I believe the fix is to insert 'oldDirSep = dirSep' as follows:
      
        again:
          if (IsSeparatorOrNull(dirSep[2])) {
      /* Need to skip '.' in the path */
      if (retVal == NULL) {
          CONST char *path = Tcl_GetString(pathPtr);
          retVal = Tcl_NewStringObj(path, dirSep - path);
          Tcl_IncrRefCount(retVal);
      }
      dirSep += 2;
      oldDirSep = dirSep;
      if (dirSep[0] != 0 && dirSep[1] == '.') {
          goto again;
      }
      continue;
          }
      
      thanks for tracking this down, and please do test the above....
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  6. Ticket change [ab6d3a5d59] (rid 101113) by vincentdarley on 2004-01-23 18:11:42:

    1. closedate changed to: "2004-01-23T11:11:42"
    2. closer changed to: "vincentdarley"
    3. icomment:
      Logged In: YES 
      user_id=32170
      
      I believe I fixed this now.  Please try cvs head, which also
      has several new tests.
      
      
      
    4. login: "vincentdarley"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "vincentdarley"