Fixed crash in open file dialog on non-windows 98 emulation when

lpszInitialDir is null.
oldstable
Jason Edmeades 2002-06-25 02:55:53 +00:00 committed by Alexandre Julliard
parent 99b3307406
commit 07e2634753
1 changed files with 8 additions and 1 deletions

View File

@ -1124,7 +1124,14 @@ static LRESULT FILEDLG95_InitControls(HWND hwnd)
if (result) {
strcpy(fodInfos->ofnInfos->lpstrFile, nameBit);
*nameBit = 0x00;
strcpy((LPSTR) fodInfos->ofnInfos->lpstrInitialDir, tmpBuf);
if (fodInfos->ofnInfos->lpstrInitialDir == NULL) {
initDir = MemAlloc(strlen(tmpBuf) + 1);
fodInfos->ofnInfos->lpstrInitialDir = initDir;
strcpy(initDir, tmpBuf);
handledPath = TRUE;
} else {
strcpy((LPSTR)fodInfos->ofnInfos->lpstrInitialDir, tmpBuf);
}
handledPath = TRUE;
TRACE("Value in lpstrFile includes path, overriding lpstrInitialDir: %s, %s\n",
fodInfos->ofnInfos->lpstrFile, fodInfos->ofnInfos->lpstrInitialDir);