зеркало из https://github.com/mozilla/gecko-dev.git
Changed nsFilePicker::Show to set a larger buffer for the directory name string and make sure to free the memory returned by GetPath(),
bug 83345, r=law, sr=blizzard, a=blizzard.
This commit is contained in:
Родитель
5892765fc6
Коммит
d5a92356a7
|
@ -100,10 +100,12 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
|
||||||
|
|
||||||
if (mMode == modeGetFolder) {
|
if (mMode == modeGetFolder) {
|
||||||
|
|
||||||
|
char dirBuffer[MAX_PATH+1];
|
||||||
|
PL_strncpy(dirBuffer, initialDir, MAX_PATH);
|
||||||
BROWSEINFO browserInfo;
|
BROWSEINFO browserInfo;
|
||||||
browserInfo.hwndOwner = mWnd;
|
browserInfo.hwndOwner = mWnd;
|
||||||
browserInfo.pidlRoot = nsnull;
|
browserInfo.pidlRoot = nsnull;
|
||||||
browserInfo.pszDisplayName = (LPSTR)initialDir;
|
browserInfo.pszDisplayName = (LPSTR)dirBuffer;
|
||||||
browserInfo.lpszTitle = title;
|
browserInfo.lpszTitle = title;
|
||||||
browserInfo.ulFlags = BIF_RETURNONLYFSDIRS;//BIF_STATUSTEXT | BIF_RETURNONLYFSDIRS;
|
browserInfo.ulFlags = BIF_RETURNONLYFSDIRS;//BIF_STATUSTEXT | BIF_RETURNONLYFSDIRS;
|
||||||
browserInfo.lpfn = nsnull;
|
browserInfo.lpfn = nsnull;
|
||||||
|
@ -211,6 +213,9 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (initialDir)
|
||||||
|
nsMemory::Free(initialDir);
|
||||||
|
|
||||||
if (title)
|
if (title)
|
||||||
nsMemory::Free( title );
|
nsMemory::Free( title );
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче