зеркало из https://github.com/mozilla/pjs.git
save search part of URL when munging and reconstructing
This commit is contained in:
Родитель
2e62b59033
Коммит
36d8c5644e
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче