summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornijtmans <nijtmans>2010-04-19 11:05:32 (GMT)
committernijtmans <nijtmans>2010-04-19 11:05:32 (GMT)
commit40300691987acb670dc62904be9b327599ac90c2 (patch)
tree445a72453e505c7f754ddacd15b7a3307a40d674
parentd5d09dfa63121e855b823ca7ff91239793a1ae57 (diff)
downloadtk-40300691987acb670dc62904be9b327599ac90c2.zip
tk-40300691987acb670dc62904be9b327599ac90c2.tar.gz
tk-40300691987acb670dc62904be9b327599ac90c2.tar.bz2
Fix [Bug 2987995]: Tk_GetOpenFile returns garbage under described circumstances
-rw-r--r--ChangeLog4
-rw-r--r--win/tkWinDialog.c10
2 files changed, 8 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 738f9b6..93421a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,9 @@
2010-04-13 Jan Nijtmans <nijtmans@users.sf.net>
- * win/tkWinPort.h Fix [Patch 2986105]: conditionally defining
+ * win/tkWinPort.h Fix [Patch 2986105]: conditionally defining
strcasecmp/strncasecmp
+ * win/tkWinDialog.c Fix [Bug 2987995]: Tk_GetOpenFile returns garbage
+ under described circumstances
2010-04-12 Donal K. Fellows <dkf@users.sf.net>
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 81d795c..9e2ebe2 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.70 2010/02/05 22:45:03 nijtmans Exp $
+ * RCS: @(#) $Id: tkWinDialog.c,v 1.71 2010/04/19 11:05:33 nijtmans Exp $
*
*/
@@ -592,7 +592,7 @@ GetFileNameW(
const char *extension = NULL, *filter = NULL, *title = NULL;
Tk_Window tkwin = clientData;
HWND hWnd;
- Tcl_Obj *filterObj=NULL, *initialTypeObj=NULL, *typeVariableObj=NULL;
+ Tcl_Obj *filterObj = NULL, *initialTypeObj = NULL, *typeVariableObj = NULL;
Tcl_DString utfFilterString, utfDirString, ds;
Tcl_DString extString, filterString, dirString, titleString;
Tcl_Encoding unicodeEncoding = TkWinGetUnicodeEncoding();
@@ -986,7 +986,7 @@ OFNHookProcW(
} else if (uMsg == WM_NOTIFY) {
OFNOTIFYW *notifyPtr = (OFNOTIFYW *) lParam;
- if (notifyPtr->hdr.code == CDN_SELCHANGE) {
+ if (notifyPtr->hdr.code == CDN_FILEOK) {
int dirsize, selsize;
WCHAR *buffer;
int buffersize;
@@ -1044,7 +1044,7 @@ OFNHookProcW(
} else {
buffer[selsize] = '\0'; /* Second NULL terminator. */
- /*
+ /*
* Replace directory terminating NULL with a backslash.
*/
@@ -1517,7 +1517,7 @@ OFNHookProcA(
} else if (uMsg == WM_NOTIFY) {
OFNOTIFY *notifyPtr = (OFNOTIFY *) lParam;
- if (notifyPtr->hdr.code == CDN_SELCHANGE) {
+ if (notifyPtr->hdr.code == CDN_FILEOK) {
int dirsize, selsize;
char *buffer;
int buffersize;