mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-29 15:52:07 +00:00
241292 - proxy settings with ports specified are not imported properly. use nsCAutoStrings instead of nsDependentCStrings because we need null terminated strings containing only the fragment returned by Substring().
This commit is contained in:
parent
17531a3296
commit
deeca5d835
@ -44,10 +44,10 @@ void SetProxyPref(const nsACString& aHostPort, const char* aPref,
|
||||
{
|
||||
nsCAutoString hostPort(aHostPort);
|
||||
PRInt32 portDelimOffset = hostPort.RFindChar(':');
|
||||
if (portDelimOffset) {
|
||||
nsDependentCString host(Substring(hostPort, 0, portDelimOffset));
|
||||
nsDependentCString port(Substring(hostPort, portDelimOffset + 1,
|
||||
hostPort.Length() - (portDelimOffset + 1)));
|
||||
if (portDelimOffset > 0) {
|
||||
nsCAutoString host(Substring(hostPort, 0, portDelimOffset));
|
||||
nsCAutoString port(Substring(hostPort, portDelimOffset + 1,
|
||||
hostPort.Length() - (portDelimOffset + 1)));
|
||||
|
||||
aPrefs->SetCharPref(aPref, host.get());
|
||||
PRInt32 stringErr;
|
||||
|
Loading…
Reference in New Issue
Block a user