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:
sdagley%netscape.com 2000-02-04 04:11:51 +00:00
Родитель 2acba7159d
Коммит 0ca8ceeaaa
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -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;
}