save search part of URL when munging and reconstructing

This commit is contained in:
danm%netscape.com 1999-05-27 20:34:42 +00:00
Родитель 2e62b59033
Коммит 36d8c5644e
3 изменённых файлов: 27 добавлений и 2 удалений

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

@ -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;
}