зеркало из https://github.com/mozilla/pjs.git
[OS/2] Bug 395576: extension of downloaded files are upper-cased sometimes, r=mkaply
This commit is contained in:
Родитель
17981a2c68
Коммит
3bb651e834
|
@ -2164,20 +2164,17 @@ nsLocalFile::IsExecutable(PRBool *_retval)
|
|||
if (pathEnd == leaf)
|
||||
return NS_OK;
|
||||
|
||||
// get the extension, including the dot
|
||||
char* ext = (char*) _mbsrchr((const unsigned char*)leaf, '.');
|
||||
if (!ext)
|
||||
return NS_OK;
|
||||
// get the extension, including the dot, max. of 4 chars for comparison
|
||||
// (copy the extension so that the original filename stays untouched)
|
||||
char ext[5];
|
||||
strncpy(ext, (char*) _mbsrchr((const unsigned char*)leaf, '.'), 4);
|
||||
ext[4] = '\0'; // ensure trailing nullbyte
|
||||
|
||||
// upper-case the extension, then see if it claims to be an executable
|
||||
#ifdef MOZ_OS2_HIGH_MEMORY
|
||||
// WinUpper() cannot be used because it crashes with high memory.
|
||||
// strupr() does not take into account non-ASCII characters but this is
|
||||
// irrelevant for the possible extensions below
|
||||
strupr(ext);
|
||||
#else
|
||||
WinUpper(0, 0, 0, ext);
|
||||
#endif
|
||||
if (strcmp(ext, ".EXE") == 0 ||
|
||||
strcmp(ext, ".CMD") == 0 ||
|
||||
strcmp(ext, ".COM") == 0 ||
|
||||
|
|
Загрузка…
Ссылка в новой задаче