105b5d3fbb1c00bb0aeaf9d3e0fbe26a7b1993fc introduced a dependency on mkdtemp, which is not available on Windows. Restore the original temporary directory behavior for Windows so that gitk creates temporary directories in the current repository. The Unix code path retains new TMPDIR behavior. Reported-by: Pat Thoyts <patthoyts@xxxxxxxxxxxxxxxxxxxxx> Helped-by: brian m. carlson <sandals@xxxxxxxxxxxxxxxxxxxx> Signed-off-by: David Aguilar <davvid@xxxxxxxxx> --- gitk | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/gitk b/gitk index 41e5071..66d8c9e 100755 --- a/gitk +++ b/gitk @@ -3496,15 +3496,22 @@ proc gitknewtmpdir {} { global diffnum gitktmpdir gitdir env if {![info exists gitktmpdir]} { - if {[info exists env(GITK_TMPDIR)]} { - set tmpdir $env(GITK_TMPDIR) - } elseif {[info exists env(TMPDIR)]} { - set tmpdir $env(TMPDIR) + if {$::tcl_platform(platform) eq {windows}} { + # Windows does not have mkdtemp so use the current directory + # to avoid using an unsafe pattern in a world-writeable + # temporary directory. + set gitktmpdir [file join $gitdir [format ".gitk-tmp.%s" [pid]]] } else { - set tmpdir $gitdir + if {[info exists env(GITK_TMPDIR)]} { + set tmpdir $env(GITK_TMPDIR) + } elseif {[info exists env(TMPDIR)]} { + set tmpdir $env(TMPDIR) + } else { + set tmpdir $gitdir + } + set gitktmpformat [file join $tmpdir ".gitk-tmp.XXXXXX"] + set gitktmpdir [exec mktemp -d $gitktmpformat] } - set gitktmpformat [file join $tmpdir ".gitk-tmp.XXXXXX"] - set gitktmpdir [exec mktemp -d $gitktmpformat] if {[catch {file mkdir $gitktmpdir} err]} { error_popup "[mc "Error creating temporary directory %s:" $gitktmpdir] $err" unset gitktmpdir -- 2.0.0.257.g75cc6c6 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html