diff --git a/chrome/src/nsChromeRegistry.cpp b/chrome/src/nsChromeRegistry.cpp index a26da918f7f..89bf8ef1336 100644 --- a/chrome/src/nsChromeRegistry.cpp +++ b/chrome/src/nsChromeRegistry.cpp @@ -226,12 +226,16 @@ nsChromeRegistry::ConvertChromeURL(nsIURL* aChromeURL) } nsAutoString hostStr(host); + const char* file; // Construct a chrome URL and use it to look up a resource. nsAutoString windowType = nsAutoString("chrome://") + hostStr + "/"; + // Stash any search part of the URL for later + aChromeURL->GetSearch(&file); + nsAutoString searchStr(file); + // Find out the provider type of the URL - const char* file; aChromeURL->GetFile(&file); nsAutoString restOfURL(file); @@ -308,7 +312,12 @@ nsChromeRegistry::ConvertChromeURL(nsIURL* aChromeURL) } char* finalDecision = chromeBase.ToNewCString(); + char* search = searchStr.ToNewCString(); aChromeURL->SetSpec(finalDecision); + if (search && *search) { + aChromeURL->SetSearch(search); + delete []search; + } delete []finalDecision; return NS_OK; } diff --git a/network/module/nsNetService.cpp b/network/module/nsNetService.cpp index fc6065675a5..547ddd8bdf5 100644 --- a/network/module/nsNetService.cpp +++ b/network/module/nsNetService.cpp @@ -407,11 +407,18 @@ nsresult nsNetlibService::OpenStream(nsIURL *aUrl, if (PL_strcmp(protocol, "resource") == 0) { char* fileName; + char* search; const char* file; + aUrl->GetSearch(&file); + search = XP_STRDUP(file); result = aUrl->GetFile(&file); NS_ASSERTION(result == NS_OK, "deal with this"); fileName = mangleResourceIntoFileURL(file); aUrl->SetSpec(fileName); + if (search) { + aUrl->SetSearch(search); + PR_Free(search); + } PR_Free(fileName); } diff --git a/rdf/chrome/src/nsChromeRegistry.cpp b/rdf/chrome/src/nsChromeRegistry.cpp index a26da918f7f..89bf8ef1336 100644 --- a/rdf/chrome/src/nsChromeRegistry.cpp +++ b/rdf/chrome/src/nsChromeRegistry.cpp @@ -226,12 +226,16 @@ nsChromeRegistry::ConvertChromeURL(nsIURL* aChromeURL) } nsAutoString hostStr(host); + const char* file; // Construct a chrome URL and use it to look up a resource. nsAutoString windowType = nsAutoString("chrome://") + hostStr + "/"; + // Stash any search part of the URL for later + aChromeURL->GetSearch(&file); + nsAutoString searchStr(file); + // Find out the provider type of the URL - const char* file; aChromeURL->GetFile(&file); nsAutoString restOfURL(file); @@ -308,7 +312,12 @@ nsChromeRegistry::ConvertChromeURL(nsIURL* aChromeURL) } char* finalDecision = chromeBase.ToNewCString(); + char* search = searchStr.ToNewCString(); aChromeURL->SetSpec(finalDecision); + if (search && *search) { + aChromeURL->SetSearch(search); + delete []search; + } delete []finalDecision; return NS_OK; }