From ad28f39c0b1796874ecaa8589b029cac3074f5a8 Mon Sep 17 00:00:00 2001 From: dkf Date: Wed, 11 Aug 2004 22:22:02 +0000 Subject: Don't add the default extension to env-var references --- library/tkfbox.tcl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index de4b618..ae03387 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -11,7 +11,7 @@ # files by clicking on the file icons or by entering a filename # in the "Filename:" entry. # -# RCS: @(#) $Id: tkfbox.tcl,v 1.45 2004/08/11 21:24:25 dkf Exp $ +# RCS: @(#) $Id: tkfbox.tcl,v 1.46 2004/08/11 22:22:02 dkf Exp $ # # Copyright (c) 1994-1998 Sun Microsystems, Inc. # @@ -1418,7 +1418,10 @@ proc ::tk::dialog::file::ResolveFile {context text defaultext {expandEnv 1}} { # If the file has no extension, append the default. Be careful not # to do this for directories, otherwise typing a dirname in the box # will give back "dirname.extension" instead of trying to change dir. - if {![file isdirectory $path] && [string equal [file ext $path] ""]} { + if { + ![file isdirectory $path] && ([file ext $path] eq "") && + ![string match {$*} [file tail $path]] + } then { set path "$path$defaultext" } -- cgit v0.12