提交 9bedb0e1 编写于 作者: P Pat Thoyts 提交者: Paul Mackerras

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: NPat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: NPaul Mackerras <paulus@samba.org>
上级 c21398be
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册