summaryrefslogtreecommitdiffstats
path: root/win/tkWinDialog.c
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-05-19 11:22:59 (GMT)
committernijtmans <nijtmans>2010-05-19 11:22:59 (GMT)
commit6f6de19f4f66f9f446af059151dafc02c3ada12b (patch)
treed581101ee645bb7e19991aa719b686432996e99d /win/tkWinDialog.c
parentc1691020fc8f86117264bef7e71e4044a0b5ee25 (diff)
downloadtk-6f6de19f4f66f9f446af059151dafc02c3ada12b.zip
tk-6f6de19f4f66f9f446af059151dafc02c3ada12b.tar.gz
tk-6f6de19f4f66f9f446af059151dafc02c3ada12b.tar.bz2
Fix [Bug #3002230]: tk_chooseDirectory returns garbage on cancel
Diffstat (limited to 'win/tkWinDialog.c')
-rw-r--r--win/tkWinDialog.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index af36993..6783585 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -8,7 +8,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkWinDialog.c,v 1.50.2.8 2010/05/17 14:35:00 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinDialog.c,v 1.50.2.9 2010/05/19 11:22:59 nijtmans Exp $
*
*/
@@ -2033,6 +2033,13 @@ Tk_ChooseDirectoryObjCmd(
pidl = SHBrowseForFolder(&bInfo);
/*
+ * This is a fix for Windows 2000, which seems to modify the folder name
+ * buffer even when the dialog is canceled (in this case the buffer
+ * contains garbage). See [Bug #3002230]
+ */
+ path[0] = '\0';
+
+ /*
* Null for cancel button or invalid dir, otherwise valid.
*/