зеркало из https://github.com/mozilla/gecko-dev.git
Bug 105151; check for ERROR_INVALID_PARAMATER and retry with empty file name (because we get that when the file name is too long); r=bryner, sr=hyatt
This commit is contained in:
Родитель
0e2e20f34f
Коммит
87e765c949
|
@ -187,6 +187,16 @@ NS_IMETHODIMP nsFilePicker::Show(PRInt16 *retval)
|
|||
}
|
||||
else if (mMode == modeSave) {
|
||||
result = ::GetSaveFileName(&ofn);
|
||||
if (!result) {
|
||||
// Error, find out what kind.
|
||||
DWORD error = ::GetLastError();
|
||||
if (error == ERROR_INVALID_PARAMETER) {
|
||||
// Parameter error; probably the default file name is too long.
|
||||
// Try again, without a starting file name.
|
||||
ofn.lpstrFile[0] = 0;
|
||||
result = ::GetSaveFileName(&ofn);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
NS_ASSERTION(0, "Only load, save and getFolder are supported modes");
|
||||
|
|
Загрузка…
Ссылка в новой задаче