fix bug 113032 [jar: anchors within pages drop the HTML file name] fix resolving relative jar urls, fix anchor handling in jar urls, r=darin, sr=bzbarsky
git-svn-id: svn://10.0.0.236/trunk@139530 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -335,12 +335,27 @@ nsJARURI::Resolve(const nsACString &relativePath, nsACString &result)
|
||||
}
|
||||
|
||||
nsCAutoString path(mJAREntry);
|
||||
PRInt32 pos = path.RFind("/");
|
||||
if (pos >= 0)
|
||||
path.Truncate(pos + 1);
|
||||
else
|
||||
path = "";
|
||||
PRInt32 pos = 0;
|
||||
|
||||
char first = relativePath.Length() > 0 ? relativePath.First() : '#';
|
||||
|
||||
switch (first) {
|
||||
case '/':
|
||||
path = "";
|
||||
break;
|
||||
case '?':
|
||||
case '#':
|
||||
pos = path.RFindChar(first);
|
||||
if (pos >= 0)
|
||||
path.Truncate(pos);
|
||||
break;
|
||||
default:
|
||||
pos = path.RFindChar('/');
|
||||
if (pos >= 0)
|
||||
path.Truncate(pos + 1);
|
||||
else
|
||||
path = "";
|
||||
}
|
||||
nsCAutoString resolvedEntry;
|
||||
rv = net_ResolveRelativePath(relativePath, path,
|
||||
resolvedEntry);
|
||||
|
||||
Reference in New Issue
Block a user