Bug 132183 - Chrome registry doesn't handle uppercase package names; normalize all packages to lowercase, r=darin+Neil

This commit is contained in:
bsmedberg%covad.net 2005-12-14 15:49:23 +00:00
parent d5e67095bf
commit a12f59b07e

View File

@ -2018,6 +2018,16 @@ CheckVersionFlag(const nsSubstring& aFlag, const nsSubstring& aData,
return PR_TRUE;
}
static void
EnsureLowerCase(char *aBuf)
{
for (; *aBuf; ++aBuf) {
char ch = *aBuf;
if (ch >= 'A' && ch <= 'Z')
*aBuf = ch + 'a' - 'A';
}
}
nsresult
nsChromeRegistry::ProcessManifestBuffer(char *buf, PRInt32 length,
nsILocalFile* aManifest,
@ -2083,6 +2093,8 @@ nsChromeRegistry::ProcessManifestBuffer(char *buf, PRInt32 length,
continue;
}
EnsureLowerCase(package);
// NOTE: We check for platform and xpcnativewrappers modifiers on
// content packages, but they are *applied* to content|skin|locale.
@ -2157,6 +2169,8 @@ nsChromeRegistry::ProcessManifestBuffer(char *buf, PRInt32 length,
continue;
}
EnsureLowerCase(package);
TriState stAppVersion = eUnspecified;
TriState stApp = eUnspecified;
@ -2205,6 +2219,8 @@ nsChromeRegistry::ProcessManifestBuffer(char *buf, PRInt32 length,
continue;
}
EnsureLowerCase(package);
TriState stAppVersion = eUnspecified;
TriState stApp = eUnspecified;