summaryrefslogtreecommitdiffstats
path: root/win/tkWinDialog.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-14 13:46:14 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2012-11-14 13:46:14 (GMT)
commite6b1227197ceae9a613a6b8e0866e592407bff97 (patch)
treee07c8dd167bd8557ed4d325d50996bdd52da0cff /win/tkWinDialog.c
parentae223cc57f222301cee05402a33eebfbb91a38c4 (diff)
downloadtk-e6b1227197ceae9a613a6b8e0866e592407bff97.zip
tk-e6b1227197ceae9a613a6b8e0866e592407bff97.tar.gz
tk-e6b1227197ceae9a613a6b8e0866e592407bff97.tar.bz2
Bug 3500545: tk_getOpenFile -multiple 1 wrong on windows
Diffstat (limited to 'win/tkWinDialog.c')
-rw-r--r--win/tkWinDialog.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 9263830..3663807 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -1034,14 +1034,24 @@ OFNHookProc(
}
*tmp = '\0'; /* Second NULL terminator. */
} else {
- buffer[selsize] = '\0'; /* Second NULL terminator. */
- /*
- * Replace directory terminating NULL with a backslash.
+ /*
+ * Replace directory terminating NULL with a with a backslash,
+ * but only if not an absolute path.
*/
- buffer--;
- *buffer = '\\';
+ Tcl_DString tmpfile;
+ ConvertExternalFilename(buffer, &tmpfile);
+ if (TCL_PATH_ABSOLUTE ==
+ Tcl_GetPathType(Tcl_DStringValue(&tmpfile))) {
+ /* re-get the full path to the start of the buffer */
+ buffer = (TCHAR *) ofnData->dynFileBuffer;
+ SendMessage(hdlg, CDM_GETSPEC, selsize, (LPARAM) buffer);
+ } else {
+ *(buffer-1) = '\\';
+ }
+ buffer[selsize] = '\0'; /* Second NULL terminator. */
+ Tcl_DStringFree(&tmpfile);
}
} else {
/*