зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1393230 - Part 2: Fix more improper string usages. r=njn
This fixes improper usages of Find where an offset was actually being use for the boolean ignore case flag. It also fixes a few instances of passing in a literal wchar_t to our functions where a NS_LITERAL_STRING or char16_t should be used instead.
This commit is contained in:
Родитель
9cd333b2ef
Коммит
70ece631cb
|
@ -93,7 +93,7 @@ CacheDirAndAutoClear(nsIProperties* aDirSvc, const char* aDirKey,
|
|||
MOZ_ALWAYS_SUCCEEDS(dirToCache->GetPath(**cacheVar));
|
||||
|
||||
// Convert network share path to format for sandbox policy.
|
||||
if (Substring(**cacheVar, 0, 2).Equals(L"\\\\")) {
|
||||
if (Substring(**cacheVar, 0, 2).Equals(NS_LITERAL_STRING("\\\\"))) {
|
||||
(*cacheVar)->InsertLiteral(u"??\\UNC", 1);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ IsMatchWildcard(const nsACString& aHost, const nsACString& aOverride)
|
|||
tokenEnd = overrideLength; // no '*' char, match rest of string
|
||||
}
|
||||
nsAutoCString token(Substring(override, tokenStart, tokenEnd - tokenStart));
|
||||
offset = host.Find(token, offset);
|
||||
offset = host.Find(token, /* aIgnoreCase = */ false, offset);
|
||||
if (offset == -1 || (!star && offset)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ IsMatchWildcard(const nsACString& aHost, const nsACString& aOverride)
|
|||
tokenEnd = overrideLength; // no '*' char, match rest of string
|
||||
}
|
||||
nsAutoCString token(Substring(override, tokenStart, tokenEnd - tokenStart));
|
||||
offset = host.Find(token, offset);
|
||||
offset = host.Find(token, /* aIgnoreCase = */ false, offset);
|
||||
if (offset == -1 || (!star && offset)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -67,7 +67,8 @@ GdkErrorHandler(const gchar *log_domain, GLogLevelFlags log_level,
|
|||
NS_RUNTIMEABORT(message);
|
||||
|
||||
NS_NAMED_LITERAL_CSTRING(minorCodeString, " minor_code ");
|
||||
start = buffer.Find(minorCodeString, endptr - buffer.BeginReading());
|
||||
start = buffer.Find(minorCodeString, /* aIgnoreCase = */ false,
|
||||
endptr - buffer.BeginReading());
|
||||
if (!start)
|
||||
NS_RUNTIMEABORT(message);
|
||||
|
||||
|
|
|
@ -302,8 +302,8 @@ IMMHandler::IsGoogleJapaneseInputActive()
|
|||
{
|
||||
// NOTE: Even on Windows for en-US, the name of Google Japanese Input is
|
||||
// written in Japanese.
|
||||
return sIMEName.Equals(L"Google \x65E5\x672C\x8A9E\x5165\x529B "
|
||||
L"IMM32 \x30E2\x30B8\x30E5\x30FC\x30EB");
|
||||
return sIMEName.Equals(u"Google \x65E5\x672C\x8A9E\x5165\x529B "
|
||||
u"IMM32 \x30E2\x30B8\x30E5\x30FC\x30EB");
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
|
@ -1024,9 +1024,9 @@ nsLocalFile::ResolveAndStat()
|
|||
// this is usually correct
|
||||
mResolvedPath.Assign(mWorkingPath);
|
||||
|
||||
// slutty hack designed to work around bug 134796 until it is fixed
|
||||
nsAutoString nsprPath(mWorkingPath.get());
|
||||
if (mWorkingPath.Length() == 2 && mWorkingPath.CharAt(1) == L':') {
|
||||
// Make sure root paths have a trailing slash.
|
||||
nsAutoString nsprPath(mWorkingPath);
|
||||
if (mWorkingPath.Length() == 2 && mWorkingPath.CharAt(1) == u':') {
|
||||
nsprPath.Append('\\');
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче