зеркало из https://github.com/mozilla/gecko-dev.git
nsFormFrame::GetFileNameWithinPath didn't work properly for Mac or Unix paths. Found as part of investigation of bug #22428 but not a fix by itself. r=gagan
This commit is contained in:
Родитель
2acba7159d
Коммит
0ca8ceeaaa
|
@ -902,10 +902,16 @@ nsresult nsFormFrame::ProcessAsURLEncoded(nsIFormProcessor* aFormProcessor, PRBo
|
|||
const char*
|
||||
nsFormFrame::GetFileNameWithinPath(char* aPathName)
|
||||
{
|
||||
#ifdef XP_MAC
|
||||
// On a Mac the only invalid character in a file name is a : so we have to avoid
|
||||
// the test for '\'
|
||||
char* fileNameStart = PL_strrchr(aPathName, ':');
|
||||
#else
|
||||
char* fileNameStart = PL_strrchr(aPathName, '\\'); // windows
|
||||
if (!fileNameStart) { // try unix
|
||||
fileNameStart = PL_strrchr(aPathName, '\\');
|
||||
fileNameStart = PL_strrchr(aPathName, '/');
|
||||
}
|
||||
#endif
|
||||
if (fileNameStart) {
|
||||
return fileNameStart+1;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче