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)
commita0426df76aa736ba2d618441232d72e4ba38a380 (patch)
tree5300191a4fb2810253818d828d6e04278ea75fbf /win/tkWinDialog.c
parentdefa6162f12bf44d8df24a341dd4727e3a23e3d0 (diff)
downloadtk-a0426df76aa736ba2d618441232d72e4ba38a380.zip
tk-a0426df76aa736ba2d618441232d72e4ba38a380.tar.gz
tk-a0426df76aa736ba2d618441232d72e4ba38a380.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);