Skip to content

Commit

Permalink
gitk: Work around leftover temporary save file
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pat Thoyts authored and Paul Mackerras committed Sep 21, 2009
1 parent c21398b commit 9bedb0e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gitk
Original file line number Diff line number Diff line change
Expand Up @@ -2526,6 +2526,7 @@ proc savestuff {w} {
if {$stuffsaved} return
if {![winfo viewable .]} return
catch {
if {[file exists ~/.gitk-new]} {file delete -force ~/.gitk-new}
set f [open "~/.gitk-new" w]
if {$::tcl_platform(platform) eq {windows}} {
file attributes "~/.gitk-new" -hidden true
Expand Down

0 comments on commit 9bedb0e

Please sign in to comment.