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,9 +93,10 @@ extern HRESULT SendCustomDlgNotificationMessage(HWND hwndParentDlg, UINT uCode);
static void COMDLG32_UpdateCurrentDir(FileOpenDlgInfos *fodInfos)
{
char lpstrPath[MAX_PATH];
SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath);
SetCurrentDirectoryA(lpstrPath);
TRACE("new current folder %s\n", lpstrPath);
if(SHGetPathFromIDListA(fodInfos->ShellInfos.pidlAbsCurrent,lpstrPath)) {
SetCurrentDirectoryA(lpstrPath);
TRACE("new current folder %s\n", lpstrPath);
}
}
/* copied from shell32 to avoid linking to it */