mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-18 17:02:01 +00:00
small changes to clients of string conversion APIs
This commit is contained in:
parent
a432077333
commit
11c6f51246
@ -135,14 +135,14 @@ nsCodebasePrincipal::GetOrigin(char **origin)
|
||||
nsXPIDLCString s;
|
||||
if (NS_FAILED(mURI->GetScheme(getter_Copies(s))))
|
||||
return NS_ERROR_FAILURE;
|
||||
nsAutoString t = (const char *) s;
|
||||
nsAutoString t(s);
|
||||
t += "://";
|
||||
if (NS_SUCCEEDED(mURI->GetHost(getter_Copies(s)))) {
|
||||
t += s;
|
||||
t.Append(s);
|
||||
} else if (NS_SUCCEEDED(mURI->GetSpec(getter_Copies(s)))) {
|
||||
// Some URIs (e.g., nsSimpleURI) don't support host. Just
|
||||
// get the full spec.
|
||||
t = s;
|
||||
t.Assign(s);
|
||||
} else {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user