summaryrefslogtreecommitdiffstats
path: root/win
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2012-11-14 16:55:00 (GMT)
committerdgp <dgp@users.sourceforge.net>2012-11-14 16:55:00 (GMT)
commitd365b8e1b7dc0f3e9dd4e917054d32ac2dde38ba (patch)
tree158ae10ddcd3a81e99aec7ddd41cdc37c1ffd288 /win
parent78719bde32acd127de584529bc9dab776ad56c1d (diff)
parented064e742e36ba2e1783c612611bc825ce79b094 (diff)
downloadtk-d365b8e1b7dc0f3e9dd4e917054d32ac2dde38ba.zip
tk-d365b8e1b7dc0f3e9dd4e917054d32ac2dde38ba.tar.gz
tk-d365b8e1b7dc0f3e9dd4e917054d32ac2dde38ba.tar.bz2
merge trunk
Diffstat (limited to 'win')
-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 {
/*