gitk: Work around leftover temporary save file
If a file exists and is hidden on Windows the Tcl open command will fail as the attributes provided in the CREAT call fail to match those of the existing file. Forcing removal of the temporary file before we begin solves any problems caused by previous failures to save the application settings. An alternative would be to remove the hidden attribute before calling 'open'. Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net> Signed-off-by: Paul Mackerras <paulus@samba.org>
Pat Thoyts committed
Sep 15, 2009 at 10:26 UTC
9bedb0e185332f9f8fb5e1c18bb5aff9964145a6
1 file changed
+1
gitk
+1
@@ -2526,6 +2526,7 @@ proc savestuff {w} {
2526
if {$stuffsaved} return
2527
if {![winfo viewable .]} return
2528
catch {
2529
+ if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new}
2530
set f [open "~/.gitk-new" w]
2531
if {$::tcl_platform(platform) eq {windows}} {
2532
file attributes "~/.gitk-new" -hidden true