Module: wine Branch: refs/heads/master Commit: e80a85a33bca104e04a3343bda46e5f19dbb153a URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=e80a85a33bca104e04a3343b...
Author: Troy Rollo wine@troy.rollo.name Date: Tue Jan 10 12:08:28 2006 +0100
shell32: Fix bug in renaming files in the file dialogs when UNIX paths are being used.
---
dlls/shell32/shfldr_unixfs.c | 12 +++++++++++- 1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c index 394a8c6..e5aee56 100644 --- a/dlls/shell32/shfldr_unixfs.c +++ b/dlls/shell32/shfldr_unixfs.c @@ -1266,7 +1266,17 @@ static HRESULT WINAPI UnixFolder_IShellF return E_FAIL;
/* Build a pidl for the path of the renamed file */ - pwszDosDest = wine_get_dos_file_name(szDest); + if (This->m_dwPathMode == PATHMODE_DOS) + { + pwszDosDest = wine_get_dos_file_name(szDest); + } + else + { + int len = MultiByteToWideChar(CP_UNIXCP, 0, szDest, -1, NULL, 0); + + pwszDosDest = HeapAlloc(GetProcessHeap(), 0, len * sizeof(WCHAR)); + MultiByteToWideChar(CP_UNIXCP, 0, szDest, -1, pwszDosDest, len); + } if (!pwszDosDest || !UNIXFS_path_to_pidl(This, pwszDosDest, &pidlDest)) { HeapFree(GetProcessHeap(), 0, pwszDosDest); rename(szDest, szSrc); /* Undo the renaming */