mirror of https://github.com/acidanthera/audk.git
Use exactly match method for HiiCompareLanguage.
Compare all of Language2 against the characters in Language1 up to the first ‘;’ or Null terminator. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11409 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
a70dbff785
commit
4a12dfd454
|
@ -1967,11 +1967,25 @@ HiiCompareLanguage (
|
|||
IN CHAR8 *Language2
|
||||
)
|
||||
{
|
||||
UINTN Language2Len;
|
||||
UINTN Index;
|
||||
|
||||
//
|
||||
// When languages are exactly same, they will be identical.
|
||||
// Compare the Primary Language in Language1 to Language2
|
||||
//
|
||||
Language2Len = AsciiStrLen (Language2);
|
||||
return (BOOLEAN) (AsciiStrnCmp (Language1, Language2, Language2Len) == 0);
|
||||
for (Index = 0; Language1[Index] != 0 && Language1[Index] != ';'; Index++) {
|
||||
if (Language1[Index] != Language2[Index]) {
|
||||
//
|
||||
// Return FALSE if any characters are different.
|
||||
//
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Only return TRUE if Language2[Index] is a Null-terminator which means
|
||||
// the Primary Language in Language1 is the same length as Language2. If
|
||||
// Language2[Index] is not a Null-terminator, then Language2 is longer than
|
||||
// the Primary Language in Language1, and FALSE must be returned.
|
||||
//
|
||||
return (Language2[Index] == 0);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue