fix bug 120959 [Use of ".." in address causes links to relative URL's

to fail] A regression from the rewrite of the urlparser,
r=dougt@netscape.com, sr=darin@netscape.com
This commit is contained in:
andreas.otte%debitel.net 2002-01-25 22:07:50 +00:00
Родитель 27978a05e9
Коммит a59c0cac45
1 изменённых файлов: 4 добавлений и 0 удалений

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

@ -325,6 +325,10 @@ nsBaseURLParser::ParseFilePath(const char *filepath, PRInt32 filepathLen,
for (p = end - 1; *p != '/' && p > filepath; --p)
;
if (*p == '/') {
// catch /.. and /.
if ((p+1 < end && *(p+1) == '.') &&
(p+2 == end || (p+2 < end && *(p+2) == '.' && p+3 == end)))
p = end - 1;
// filepath = <directory><filename>.<extension>
SET_RESULT(directory, 0, p - filepath + 1);
ParseFileName(p + 1, end - (p + 1),