summaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorericm <ericm>2000-02-07 22:12:26 (GMT)
committerericm <ericm>2000-02-07 22:12:26 (GMT)
commit5268a643714d4b68022061ab3626814f3d081bd3 (patch)
treee316ae8fe0cbeb011fa6cc43745e144d7031b466 /library
parentc1f87215c2cad528ea7a4a7617b71a78fa22e077 (diff)
downloadtk-5268a643714d4b68022061ab3626814f3d081bd3.zip
tk-5268a643714d4b68022061ab3626814f3d081bd3.tar.gz
tk-5268a643714d4b68022061ab3626814f3d081bd3.tar.bz2
* library/tkfbox.tcl: Applied patch from bug #4117,
tk_getOpenFile/getSaveFile doesn't do the right thing when user types a directory name in the entry and a default extension is specified.
Diffstat (limited to 'library')
-rw-r--r--library/tkfbox.tcl7
1 files changed, 5 insertions, 2 deletions
diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl
index c5ffc87..fade2bd 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.14 2000/01/21 22:44:42 ericm Exp $
+# RCS: @(#) $Id: tkfbox.tcl,v 1.15 2000/02/07 22:12:26 ericm Exp $
#
# Copyright (c) 1994-1998 Sun Microsystems, Inc.
#
@@ -1138,7 +1138,10 @@ proc tkFDialogResolveFile {context text defaultext} {
set path [tkFDialog_JoinFile $context $text]
- if {[string equal [file ext $path] ""]} {
+ # 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] ""]} {
set path "$path$defaultext"
}