зеркало из https://github.com/mozilla/gecko-dev.git
Bug 788741 - Truncate file extension if too long r=bz
This commit is contained in:
Родитель
95f90f3341
Коммит
1eac480bd4
|
@ -2213,7 +2213,13 @@ nsWebBrowserPersist::CalculateAndAppendFileExt(nsIURI *aURI, nsIChannel *aChanne
|
|||
uint32_t newLength = newFileName.Length() + fileExt.Length() + 1;
|
||||
if (newLength > kDefaultMaxFilenameLength)
|
||||
{
|
||||
newFileName.Truncate(newFileName.Length() - (newLength - kDefaultMaxFilenameLength));
|
||||
if (fileExt.Length() > kDefaultMaxFilenameLength/2)
|
||||
fileExt.Truncate(kDefaultMaxFilenameLength/2);
|
||||
|
||||
uint32_t diff = kDefaultMaxFilenameLength - 1 -
|
||||
fileExt.Length();
|
||||
if (newFileName.Length() > diff)
|
||||
newFileName.Truncate(diff);
|
||||
}
|
||||
newFileName.Append(".");
|
||||
newFileName.Append(fileExt);
|
||||
|
|
Загрузка…
Ссылка в новой задаче