From 5268a643714d4b68022061ab3626814f3d081bd3 Mon Sep 17 00:00:00 2001 From: ericm Date: Mon, 7 Feb 2000 22:12:26 +0000 Subject: * 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. --- ChangeLog | 14 ++++++++++++++ library/tkfbox.tcl | 7 +++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 519734c..e200e1e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2000-02-07 Eric Melski + + * 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. + 2000-02-05 Jeff Hobbs * unix/tkUnixScale.c (TkpDestroyScale): changed ckfree to @@ -6,6 +13,13 @@ 2000-02-03 Eric Melski + * tests/canvText.test: test for fix for bug #2525. + + * generic/tkFont.c (Tk_ComputeTextLayout): Was erroneously setting + the width of newline-only text display chunks to some arbitrary + huge number, instead of 0; this was interfering with things like + the canvas find enclosed feature. (bug #2525). + * tests/text.test: * generic/tkText.c (DumpLine/DumpSegment): Changed DumpSegment to take a TkTextIndex instead of two integer offsets, so that it 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" } -- cgit v0.12