Artifacts Associated With Ticket 566669ffffffffffffffffffffffffffffffffff
Ticket change [80aceda7a2] (rid 116907) by taguchiv6 on 2002-06-10 03:29:15:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Under Unix env, "file dirname ~" command does not work fine. TclpObjNormalizePath() in unix/tclUnixFCmd.c has a bug. valiable "nextCheckPoint" sometime still 0, but This value is used as argments for Tcl_UtfToExternalDString(). This patch will fix this probrem. Thanks.
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "taguchiv6"
- subsystem initialized to: "16. Commands A-H"
- title initialized to: "[fix] file dirname ~"
- type initialized to: "Patch"
Ticket change [55b21a8e52] (rid 94189) by taguchiv6 on 2002-06-10 10:29:15:
- icomment:
File Added - 24762: tcl-patch-ac
- login: "taguchiv6"
- mimetype: "text/plain"
- username: "taguchiv6"
- icomment:
Add attachment "tcl-patch-ac" [b8d2950b1a] (rid 129027) by taguchiv6 on 2002-06-10 10:29:15.
Ticket change [d291b369e2] (rid 113552) by dkf on 2002-06-10 15:27:00:
- assignee changed to: "vincentdarley"
- subsystem changed to: "37. File System"
Ticket change [292429c459] (rid 88821) by vincentdarley on 2002-06-10 15:59:37:
- icomment:
Logged In: YES user_id=32170 Would 'nextCheckpoint = pathLen' work for you as well? I believe this will have the same value as 'strlen (path), and will avoid the need to recompute the length.. (which will therefore be faster, in this crucial procedure).
- login: "vincentdarley"
- mimetype: "text/plain"
- priority changed to: "7 High"
- resolution changed to: "Accepted"
- username: "vincentdarley"
- icomment:
Ticket change [8dc71fa975] (rid 127997) by nobody on 2002-06-10 17:36:37:
- icomment:
Logged In: NO What does 'file dirname ~' give for you? Can you provide a test we can add to the test suite which shows the bug? thanks,
- login: "nobody"
- mimetype: "text/plain"
- username: "nobody"
- icomment:
Ticket change [1c01ed2cfe] (rid 90529) by taguchiv6 on 2002-06-11 08:12:07:
- icomment:
File Added - 24847: tcl-patch-ac Logged In: YES user_id=357728 Here is a test sequence: 1. Original version: %puts $env(HOME) /root % puts [pwd] /usr/local/src/tcl-current/tcl/unix % file dirname ~ /usr/local/src/tcl-current/tcl/unix I think this return value is unexpected one. 2. Patched version: %puts $env(HOME) /root % puts [pwd] /usr/local/src/tcl-current/tcl/unix % file dirname ~ / I think it work fine. And thanks Vince. I cannot find out variable "pathLen" ;-) So I used strlen(3). But I think using "pathLen" is more excelent. Here is a new patch for tclUnixFCmd.c, v1.21 2002/04/07. Please commit it. Thanks.
- login: "taguchiv6"
- mimetype: "text/plain"
- username: "taguchiv6"
- icomment:
Add attachment "tcl-patch-ac" [16d83b4e07] (rid 124781) by taguchiv6 on 2002-06-11 08:12:07.
Ticket change [96540c0e3e] (rid 106305) by vincentdarley on 2002-06-11 15:32:23:
- icomment:
Logged In: YES user_id=32170 I've been informed that running the test suite with your patched version shows up a large number of errors... This means we can't commit the change. I do accept that it is a bug, though!
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [4336553dd4] (rid 116518) by taguchiv6 on 2002-06-13 11:42:48:
- icomment:
File Added - 25015: tcl-file-normalize-patch-20020613 Logged In: YES user_id=357728 How about this new patch?
- login: "taguchiv6"
- mimetype: "text/plain"
- username: "taguchiv6"
- icomment:
Add attachment "tcl-file-normalize-patch-20020613" [1a637490c7] (rid 122968) by taguchiv6 on 2002-06-13 11:42:48.
Ticket change [cc9ecb88c8] (rid 95730) by vincentdarley on 2002-06-13 15:37:40:
- icomment:
Logged In: YES user_id=32170 Looks possible! Have you run the entire test suite ('make test') with this new change? What happens? Else can someone else with a Unix machine test this... - login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Add attachment "tcl-file-normalize+dirname+tail-patch-20020618" [7f5fce2b58] (rid 97551) by taguchiv6 on 2002-06-18 14:41:22.
Ticket change [defc10fc3a] (rid 114940) by taguchiv6 on 2002-06-18 14:41:22:
- icomment:
File Added - 25299: tcl-file-normalize+dirname+tail-patch-20020618 Logged In: YES user_id=357728 Here is a new patch-set. unix/tclUnixFCmd.c: "file dirname ~" will return correct value. generic/tclFileName.c: Special case. if env(HOME) == "~", then "file dirname ~" must return "~". generic/tclCmdAH.c: same case. if env(HOME) == "~", then "file tail ~" must return "". These behaviors are written in test code. I've tested them using "make test". I think these patch work fine. some tests for "file" command and filesystem will repare by this patch. Thanks.
- login: "taguchiv6"
- mimetype: "text/plain"
- username: "taguchiv6"
- icomment:
Ticket change [b7b9baa41e] (rid 128847) by vincentdarley on 2002-06-18 17:37:04:
- assignee changed to: "dkf"
- icomment:
Logged In: YES user_id=32170 Assigning to Donal for his opinion on validity of the desired behaviour (the patch itself needs to be rewritten to move the desired behaviour deeper into Tcl). I don't understand the comment "these behaviours are written in test code", when Tcl 8.4 currently passes all filesystem tests on unix, yet you are saying Tcl 8.4's behaviour is wrong? Can you provide some new tests which (a) fail on Tcl 8.4 (and 8.3?) at present, but (b) pass with your patch? cheers, Vince.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
Ticket change [2f20bb40f9] (rid 93004) by vincentdarley on 2002-06-21 23:29:41:
- closedate changed to: "2002-06-21T16:29:41"
- closer changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=32170 I must say, I cannot reproduce your "bug" at all. According to your message below, (2002-06-18), you list the desired return values for various calls. I've just compiled the latest tcl 8.4 cvs distribution and get the following: % info tclv 8.4 % file dirname ~ /home/users/v/vi % cd ~ % pwd /home/users/v/vi/vincentdarley % set env(HOME) ~ ~ % file dirname ~ ~ % file tail ~ % I don't see how these differ from what you are expecting! If you disagree, please provide a standard Tcl test which reproduces the problems you see.
- login: "vincentdarley"
- mimetype: "text/plain"
- priority changed to: "1 Zero"
- resolution changed to: "Invalid"
- status changed to: "Pending"
- username: "vincentdarley"
Ticket change [d1087721e4] (rid 113282) by taguchiv6 on 2002-06-27 12:45:02:
- icomment:
Logged In: YES user_id=357728 I've got following outputs from "make test" ==== cmdAH-8.44 Tcl_FileObjCmd: dirname FAILED ==== Contents of test case: global env set temp $env(HOME) set env(HOME) "~" testsetplatform unix set result [list [catch {file dirname ~} msg] $msg] set env(HOME) $temp set result ---- Result was: 0 /usr/local/src/tcl ---- Result should have been (exact matching): 0 ~ ==== cmdAH-8.44 FAILED ==== cmdAH-8.46 Tcl_FileObjCmd: dirname FAILED ==== Contents of test case: global env set temp $env(HOME) set env(HOME) "/home/test" testsetplatform mac set result [list [catch {file dirname ~} msg] $msg] set env(HOME) $temp set result ---- Result was: 0 usr:local:src:tcl:unixhome ---- Result should have been (exact matching): 0 home: ==== cmdAH-8.46 FAILED ==== cmdAH-9.43 Tcl_FileObjCmd: tail FAILED ==== Contents of test case: global env set temp $env(HOME) set env(HOME) "~" testsetplatform unix set result [file tail ~] set env(HOME) $temp set result ---- Result was: unix~ ---- Result should have been (exact matching): ==== cmdAH-9.43 FAILED ... [snip] ... ==== filename-11.13 Tcl_GlobCmd FAILED ==== Contents of test case: list [catch {file join [lindex [glob ~] 0]} msg] $msg ---- Result was: 1 {no files matched glob pattern "~"} ---- Result should have been (exact matching): 0 /root ==== filename-11.13 FAILED ==== filename-11.45 Tcl_GlobCmd on root volume FAILED ==== Contents of test case: set res1 "" set res2 "" catch { set res1 [glob -dir [lindex [file volumes] 0] -tails *] } catch { set tmpd [pwd] cd [lindex [file volumes] 0] set res2 [glob *] cd $tmpd } expr {$res1 == $res2} ---- Result was: 0 ---- Result should have been (exact matching): 1 ==== filename-11.45 FAILED ==== filesystem-5.1 cache and ~ FAILED ==== Contents of test case: set orig $env(HOME) set ::env(HOME) /foo/bar/blah set testdir ~ set res1 "Parent of ~ (/foo/bar/blah) is [file dirname $testdir]" set ::env(HOME) /a/b/c set res2 "Parent of ~ (/a/b/c) is [file dirname $testdir]" set ::env(HOME) $orig list $res1 $res2 ---- Result was: {Parent of ~ (/foo/bar/blah) is /usr/local/src/tcl/unix/foo/bar} {Parent of ~ (/ a/b/c) is /usr/local/src/tcl/unix/a/b} ---- Result should have been (regexp matching): {Parent of ~ \(/foo/bar/blah\) is (/foo/bar|foo:bar)} {Parent of ~ \(/a/b/c\) is (/a/b|a:b)} ==== filesystem-5.1 FAILED - login: "taguchiv6"
- mimetype: "text/plain"
- status changed to: "Open"
- username: "taguchiv6"
- icomment:
Ticket change [c1ff4d88b5] (rid 111420) by vincentdarley on 2002-06-27 15:21:15:
- assignee changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=32170 Could you give some more details of your platform (what version of what unix)? Unless we can reliably reproduce this problem and find the root cause of it, we can't fix it. Clearly on the unix platform I tested (Linux), this problem isn't seen. Nor on Windows or MacOS. The patch you've given addresses the symptom of the problem you are seeing, but not the root cause, so we cannot apply that as is.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
Ticket change [c497a26c60] (rid 111868) by vincentdarley on 2002-06-27 19:29:26:
- closedate changed to: "2002-06-27T12:29:26"
- closer changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=32170 Applied fix to cvs head. Note that fix is different to attached patches.
- login: "vincentdarley"
- mimetype: "text/plain"
- priority changed to: "5 Medium"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "vincentdarley"
Ticket change [7a9f92bb43] (rid 90359) by taguchiv6 on 2002-06-28 08:48:44:
- closedate changed to: "2002-06-28T01:48:44"
- closer changed to: "taguchiv6"
- icomment:
Logged In: YES user_id=357728 Thanks, Vince! My plathomes are: FreeBSD-3.2, 4.5, 4.6, and FreeBSD-5.0. Under all version of FreeBSD, this probrem has fixed. Thanks.
- login: "taguchiv6"
- mimetype: "text/plain"
- username: "taguchiv6"