summaryrefslogtreecommitdiffstats
path: root/win/tkWinDialog.c
diff options
context:
space:
mode:
authorashok <ashok>2014-09-20 03:17:35 (GMT)
committerashok <ashok>2014-09-20 03:17:35 (GMT)
commit9f74692b1f95fcdd80c669bbb3c54e851736a87d (patch)
tree5300191a4fb2810253818d828d6e04278ea75fbf /win/tkWinDialog.c
parente8834b286e6b85771b2f3a2925c059fbc2ff690a (diff)
downloadtk-9f74692b1f95fcdd80c669bbb3c54e851736a87d.zip
tk-9f74692b1f95fcdd80c669bbb3c54e851736a87d.tar.gz
tk-9f74692b1f95fcdd80c669bbb3c54e851736a87d.tar.bz2
Convert native paths returned from file dialogs to Tcl canonical paths.
Diffstat (limited to 'win/tkWinDialog.c')
-rw-r--r--win/tkWinDialog.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/win/tkWinDialog.c b/win/tkWinDialog.c
index 3130cf2..67f0df4 100644
--- a/win/tkWinDialog.c
+++ b/win/tkWinDialog.c
@@ -1387,8 +1387,13 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr,
hr = itemIf->lpVtbl->GetDisplayName(itemIf,
SIGDN_FILESYSPATH, &wstr);
if (SUCCEEDED(hr)) {
- Tcl_ListObjAppendElement(interp, multiObj,
- Tcl_NewUnicodeObj(wstr, -1));
+ Tcl_DString fnds;
+ ConvertExternalFilename(wstr, &fnds);
+ CoTaskMemFree(wstr);
+ Tcl_ListObjAppendElement(
+ interp, multiObj,
+ Tcl_NewStringObj(Tcl_DStringValue(&fnds),
+ Tcl_DStringLength(&fnds)));
}
itemIf->lpVtbl->Release(itemIf);
if (FAILED(hr))
@@ -1408,7 +1413,10 @@ static int GetFileNameVista(Tcl_Interp *interp, OFNOpts *optsPtr,
hr = resultIf->lpVtbl->GetDisplayName(resultIf, SIGDN_FILESYSPATH,
&wstr);
if (SUCCEEDED(hr)) {
- resultObj = Tcl_NewUnicodeObj(wstr, -1);
+ Tcl_DString fnds;
+ ConvertExternalFilename(wstr, &fnds);
+ resultObj = Tcl_NewStringObj(Tcl_DStringValue(&fnds),
+ Tcl_DStringLength(&fnds));
CoTaskMemFree(wstr);
}
resultIf->lpVtbl->Release(resultIf);