diff options
author | ashok <ashok> | 2014-09-20 03:17:35 (GMT) |
---|---|---|
committer | ashok <ashok> | 2014-09-20 03:17:35 (GMT) |
commit | 9f74692b1f95fcdd80c669bbb3c54e851736a87d (patch) | |
tree | 5300191a4fb2810253818d828d6e04278ea75fbf /win/tkWinDialog.c | |
parent | e8834b286e6b85771b2f3a2925c059fbc2ff690a (diff) | |
download | tk-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.c | 14 |
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); |