|
2002-04-03
| ||
| 21:14 | • Ticket [535621ffff] clear ~ cache when ::env(HOME) changes status still Clos... artifact: 89d9ce3b5b user: dgp | |
| 15:40 | • Ticket [535621ffff]: 6 changes artifact: 8640625bf9 user: vincentdarley | |
| 15:36 | • Ticket [535621ffff]: 7 changes artifact: 37b70d1ad8 user: vincentdarley | |
| 15:35 | • Closed ticket [535621ffff]. artifact: a2a5bbfe52 user: vincentdarley | |
|
2002-03-27
| ||
| 16:59 | • Ticket [535621ffff]: 4 changes artifact: 997afc5578 user: nobody | |
| 08:00 | • New ticket [535621ffff]. artifact: 60e65b5009 user: dgp | |
clear ~ cache when ::env(HOME) changes
Closed / Fixed535621ffffffffffffffffffffffffffffffffffCreated 25 years agoUpdated 25 years ago
Descriptionplain2002-03-27 08:00:10
The normalizedPath cached inside a "pathPtr" object
needs to be invalidated when the raw string form
of the path starts with ~ and the value of ::env(HOME)
changes. Here's a demo session of the problem:
First, the working code in 8.3:
% info patch
8.3.4
% proc test {} {
set ::env(HOME) /home/dgp
puts "Parent of $::env(HOME)"
catch {file dirname ~} parent
puts "is $parent"
set ::env(HOME) /usr/local/src
puts "Parent of $::env(HOME)"
catch {file dirname ~} parent
puts "is $parent"
}
% test
Parent of /home/dgp
is /home
Parent of /usr/local/src
is /usr/local
Compare with the broken 8.4:
% info patch
8.4a5
% proc test {} {
set ::env(HOME) /home/dgp
puts "Parent of $::env(HOME)"
catch {file dirname ~} parent
puts "is $parent"
set ::env(HOME) /usr/local/src
puts "Parent of $::env(HOME)"
catch {file dirname ~} parent
% test
Parent of /home/dgp
is /home
Parent of /usr/local/src
is /home
nobodyplain2002-03-27 16:59:18
Logged In: NO Ah! Interesting -- I didn't think of that. Fortunately there's a method in place to invalidate the cache, so it just needs calling when env(HOME) changes. Calling Tcl_FSMountsChanged(NULL); will do the trick. Unfortunately I'm travelling for the next week so can't make a patch.
vincentdarley Closed ticket [535621ffff].
[History diff]2002-04-03 15:35:59
vincentdarleyplain2002-04-03 15:36:00
Logged In: YES user_id=32170 Applying patch to fix this problem.
vincentdarleyplain2002-04-03 15:40:58
Logged In: YES user_id=32170 We should also add a test to fileSystem.test to check the fixed behaviour. Vince.
dgpplain2002-04-03 21:14:41
Logged In: YES user_id=80530 Actually it was a failure in test cmdAH-8.44 that lead me to the bug. A more reliable test would be a good idea though. cmdAH-8.44 only started failing after I updated the tcltest package, and only when doing make test TESTFLAGS="-singleproc 1" According to that test, and the test case in the report, the fix is effective.
Log in (anonymous is fine) to add a comment.