Do not change directory if path is invalid.

This commit is contained in:
Sander van Leeuwen 2002-06-28 17:34:57 +00:00 committed by Alexandre Julliard
parent 886bdb0dbc
commit 2021de684e
1 changed files with 4 additions and 3 deletions

View File

@ -93,10 +93,11 @@ extern HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode);
static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos)
{
char lpstrPath[MAX_PATH];
SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
if(SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath)) {
SetCurrentDirectoryA(lpstrPath);
TRACE("new current folder %s\n", lpstrPath);
}
}
/* copied from shell32 to avoid linking to it */
static HRESULT COMDLG32_StrRetToStrNW (LPVOID dest, DWORD len, LPSTRRET src, LPITEMIDLIST pidl)