Thread (16 messages) flat view 16 messages, 4 authors, 2016-06-15
STALE3730d

[PATCH 1/2] Work around leftover temporary save file.

From: Pat Thoyts <hidden>
Date: 2016-06-15 22:47:24
Subsystem: the rest · Maintainer: Linus Torvalds

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 <redacted>
---
 gitk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gitk b/gitk
index 1306178..a0214b7 100755
--- a/gitk
+++ b/gitk
@@ -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
-- 
1.6.4.msysgit.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help