Bug 321706 – Some elements of pages in sub-directories are not loaded if the URL ends by /.

patch by Florian Quèze <f.qu@queze.net>, r+sr=cbiesinger


git-svn-id: svn://10.0.0.236/trunk@227432 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
db48x%yahoo.com 2007-06-03 14:31:14 +00:00
parent 1cd0532ed5
commit 2fc2454326
2 changed files with 22 additions and 7 deletions

View File

@ -359,12 +359,6 @@ net_CoalesceDirs(netCoalesceFlags flags, char* path)
*urlPtr++ = *fwdPtr;
}
}
// Copy remaining stuff past the #?;
for (; *fwdPtr != '\0'; ++fwdPtr)
{
*urlPtr++ = *fwdPtr;
}
*urlPtr = '\0'; // terminate the url
/*
* Now lets remove trailing . case
@ -372,7 +366,14 @@ net_CoalesceDirs(netCoalesceFlags flags, char* path)
*/
if ((urlPtr > (path+1)) && (*(urlPtr-1) == '.') && (*(urlPtr-2) == '/'))
*(urlPtr-1) = '\0';
urlPtr--;
// Copy remaining stuff past the #?;
for (; *fwdPtr != '\0'; ++fwdPtr)
{
*urlPtr++ = *fwdPtr;
}
*urlPtr = '\0'; // terminate the url
}
nsresult

View File

@ -0,0 +1,14 @@
const Cc = Components.classes;
const Ci = Components.interfaces;
const url = "http://foo.com/folder/file?/.";
function run_test() {
var ios = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
var newURI = ios.newURI(url, null, null);
do_check_eq(newURI.spec, url);
do_check_eq(newURI.path, "/folder/file?/.");
do_check_eq(newURI.resolve("./file?/."), url);
}