Skip to content
Tcl Source Code History Of Ticket 530960ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 530960ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 530960ffffffffffffffffffffffffffffffffff

  1. Ticket change [e566a8bc8d] (rid 88123) by jcw on 2002-03-17 14:26:19:

    1. assignee initialized to: "vincentdarley"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The sequence "cd \\; puts [glob *]" returns a list where 
      each first character is lost.  This does not happen on 
      WinNT4, but always on Win98SE.
      
      Using "glob ./*" works as expected, though.
      
      I suspect that this may also be the reason why exec 
      fails (for example: "exec command /c dir"), complaining 
      about not beign able to find COMMAND.COM.
      
      This problem exists in ActiveTcl 8.4 beta (i.e. 8.4a4), 
      and in the current cvs HEAD (i.e. 8.4a5).
      
      I've looked in the glob code, which changed due to the 
      new VFS layer, but have not been able to figure it out.
      
      
    4. foundin initialized to: "obsolete: 8.4a4"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "jcw"
    9. subsystem initialized to: "36. Pathname Management"
    10. title initialized to: "Glob munges 1st char on Win98"
    11. type initialized to: "Bug"
  2. Add attachment "globroot.txt" [1c645f8324] (rid 90595) by jcw on 2002-03-17 21:26:19.

  3. Ticket change [ee4731691c] (rid 104055) by jcw on 2002-03-17 21:26:19:

    1. icomment:
      
      
      File Added - 19512: globroot.txt
      
      
      
    2. login: "jcw"
    3. mimetype: "text/plain"
    4. username: "jcw"
  4. Ticket change [05460f6c37] (rid 89028) by vincentdarley on 2002-03-18 05:56:54:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      I can't really debug this since I don't have any Win98 
      machines to test on at all.  However, the bug occurs for 
      one of three potential reasons.  First off, the way 'glob 
      *' in the new fs works is to do a 'glob -dir [pwd] *' and 
      strip off the pwd (for reasons explained in the comments in 
      the code).  What is happening therefore is that too much is 
      being stripped off.
      
      Why?  Back to the three potential reasons:
      
      (i) there's a bug in the code doing the stripping, (around 
      line 1730 in tclIOUtil.c)
      
      (ii) there's an assumption in the code (in a variety of 
      places, I believe), that '[pwd]' is a normalized path which 
      does not end in a directory delimiter, _unless_ it is the 
      name of a root volume, in which case it will end in a 
      delimiter.  On Windows, normalized paths contain forward 
      slashes, not backslashes.  So I would hope 'pwd' is 'C:/' 
      in the above case.  (and not C:\\ or C:).  So, please check 
      this out!  If 'pwd' is incorrect, then code elsewhere needs 
      fixing.
      
      (iii) since the stripping works simply be checking how 
      long 'pwd' is, and removing that, if 'glob -dir [pwd] *' is 
      returning the wrong answer, (e.g. it returns C:Windows, 
      skipping the slash), then the fault lies in 
      TclpMatchInDirectory in win/tclWinFile.c
      
      Hope that helps you to track it down.
      
      Vince.
      
      
      
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. priority changed to: "7 High"
    5. username: "vincentdarley"
  5. Ticket change [c2b2080d56] (rid 111525) by vincentdarley on 2002-03-18 06:00:26:

    1. icomment:
      Logged In: YES 
      user_id=32170
      
      What do these return:
      
      glob -dir / *
      glob -dir \\ *
      glob -dir C:/
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  6. Ticket change [a0a9f66865] (rid 96857) by jcw on 2002-03-18 15:03:14:

    1. icomment:
      Logged In: YES 
      user_id=1983
      
      All of glob -dir / *, \\ *, C:/ * seem to return the expected 
      values.  But [pwd] returns paths with backslahes, so it looks 
      like (ii) is the issue here.
      
      I'll chase this further, thanks for these very helpful notes.
      
      
      
    2. login: "jcw"
    3. mimetype: "text/plain"
    4. username: "jcw"
  7. Ticket change [aafe128831] (rid 101017) by jcw on 2002-03-18 15:35:49:

    1. icomment:
      Logged In: YES 
      user_id=1983
      
      Well, 'pwd' does the right thing.  It's "file normalize" that 
      messes it up again.  With a non-existent dir (and going to 
      ActiveTcl 8.4 beta to make sure it wasn't the extra VFS 
      layer):
      
        file normalize c:/a  ->  C:/a
      
      With an existing dir, though:
      
        file normalize c:/windows  ->  C:\WINDOWS
      
      
      
    2. login: "jcw"
    3. mimetype: "text/plain"
    4. username: "jcw"
  8. Ticket change [c0a14c8a0f] (rid 102441) by nobody on 2002-03-18 15:35:52:

    1. icomment:
      Logged In: NO 
      
      Hang on!  I just remembered that to solve the big slowdown 
      on Win95/98 with the vfs code we had to make normalized 
      paths on those platforms have backslashes (and be 
      the 'short' form of a path).  On Win NT/2000/XP the 
      normalized form has forward slashes and the 'long form'.
      
      This means 'pwd' should be C:\ on 98, and the problem is 
      around line 1730 in tclIOUtil.c.  How about using the 
      following block of code there:
      
      cwdDir = Tcl_DuplicateObj(cwd);
      Tcl_IncrRefCount(cwdDir);
      cwdStr = Tcl_GetStringFromObj(cwdDir, 
      &cwdLen);
      #ifdef __WIN32__
      if ((cwdStr[cwdLen-1] != sep) && (cwdStr
      [cwdLen-1] != '\\')) {
      #else
      if (cwdStr[cwdLen-1] != sep) {
      #endif
          Tcl_AppendToObj(cwdDir, &sep, 1);
          cwdLen++;
          /* Note: cwdStr may no longer be a 
      valid pointer */
      }
      
      
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  9. Ticket change [0d87e94921] (rid 114377) by jcw on 2002-03-18 15:48:07:

    1. icomment:
      Logged In: YES 
      user_id=1983
      
      Yep, that did it (changed to \ to \\ of course).
      
      Btw, the "short native form on 9x vs. long /'ed one on NT 
      etc" is a horrible difference - I'd hope it gets documented 
      in BLINKING RED - because this can easily trip over people 
      who need to retain compatibility with 9x.
      
      Ok, great.  Solved - thanks for the really quick turnaround.
      
      
      
    2. login: "jcw"
    3. mimetype: "text/plain"
    4. username: "jcw"
  10. Ticket change [5c33c71eba] (rid 115257) by jcw on 2002-03-18 15:53:54:

    1. icomment:
      Logged In: YES 
      user_id=1983
      
      Hang on...
      
      It does solve the glob, but not typing "dir" in an 
      interactive shell:
      
       % dir
       couldn't execute "C:\WINDOWS\COMMAND.COM": no such file or 
      directory
      
      Note that this dir problem does not happen in Activetcl 8.4 
      beta, unly in my own (more recent?) builds.
      
      Shall I create a different bug report for this one?  
      (Assuming it is not my own bug this time)
      
      
      
    2. login: "jcw"
    3. mimetype: "text/plain"
    4. username: "jcw"
  11. Ticket change [0db12dc27e] (rid 114405) by jcw on 2002-03-18 17:09:24:

    1. icomment:
      Logged In: YES 
      user_id=1983
      
      DIR problem solved: it requires tclpip84.dll, since 
      COMMAND.COM is a 16-bit app on Win98.
      
      Ouch.  The source comment say that tclpip84.dll has to live 
      next to the tcl app/dll, but it can live in c:\windows as 
      well - which seems slightly more appropriate (there is a 
      similar issue with msvcrt.dll, which is required for tclkit 
      but does not exist on Win95).
      
      FWIW, I changed the comparison with .com to be case-
      insensitive - not sure it matters here, but it sure looks 
      like it would be better, i.e. tclWinPipe.c line 1434, strcmp 
      -> stricmp.
      
      Anyway... end of story.  All issues have been resolved... :o)
      
      
      
    2. login: "jcw"
    3. mimetype: "text/plain"
    4. username: "jcw"
  12. Ticket change [d70bd9d72b] (rid 123909) by vincentdarley on 2002-03-18 17:26:37:

    1. closedate changed to: "2002-03-18T10:26:37"
    2. closer changed to: "vincentdarley"
    3. icomment:
      Logged In: YES 
      user_id=32170
      
      Ok, I've added the fix to my patch of another bug 
      (including the 'stricmp' thing).  Thanks!
      
      
      
      
    4. login: "vincentdarley"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "vincentdarley"