summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2004-08-11 22:22:02 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2004-08-11 22:22:02 (GMT)
commitad28f39c0b1796874ecaa8589b029cac3074f5a8 (patch)
tree6eac86dde937184cf942e5289837cb66d6251e45
parent35a62312c2abb7fe1b09f1ccf4f04599f13bed0f (diff)
downloadtk-ad28f39c0b1796874ecaa8589b029cac3074f5a8.zip
tk-ad28f39c0b1796874ecaa8589b029cac3074f5a8.tar.gz
tk-ad28f39c0b1796874ecaa8589b029cac3074f5a8.tar.bz2
Don't add the default extension to env-var references
-rw-r--r--library/tkfbox.tcl7
1 files 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"
}