Skip to content

Commit 4fee099

Browse files
committed
ShellPkg/ShellProtocol: Replace ToLower()
With the newly added string function to BaseLib, replace ToLower() by StrnCharToLower(). Signed-off-by: Pierre Gondois <[email protected]>
1 parent a41eb5d commit 4fee099

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

ShellPkg/Application/Shell/ShellProtocol.c

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3472,30 +3472,6 @@ InternalEfiShellGetListAlias (
34723472
return (RetVal);
34733473
}
34743474

3475-
/**
3476-
Convert a null-terminated unicode string, in-place, to all lowercase.
3477-
Then return it.
3478-
3479-
@param Str The null-terminated string to be converted to all lowercase.
3480-
3481-
@return The null-terminated string converted into all lowercase.
3482-
**/
3483-
CHAR16 *
3484-
ToLower (
3485-
CHAR16 *Str
3486-
)
3487-
{
3488-
UINTN Index;
3489-
3490-
for (Index = 0; Str[Index] != L'\0'; Index++) {
3491-
if ((Str[Index] >= L'A') && (Str[Index] <= L'Z')) {
3492-
Str[Index] -= (CHAR16)(L'A' - L'a');
3493-
}
3494-
}
3495-
3496-
return Str;
3497-
}
3498-
34993475
/**
35003476
This function returns the command associated with a alias or a list of all
35013477
alias'.
@@ -3535,7 +3511,7 @@ EfiShellGetAlias (
35353511
return NULL;
35363512
}
35373513

3538-
ToLower (AliasLower);
3514+
StrnCharToLower (AliasLower, StrLen (AliasLower));
35393515

35403516
if (Volatile == NULL) {
35413517
GetVariable2 (AliasLower, &gShellAliasGuid, (VOID **)&AliasVal, NULL);
@@ -3625,7 +3601,7 @@ InternalSetAlias (
36253601
return EFI_OUT_OF_RESOURCES;
36263602
}
36273603

3628-
ToLower (AliasLower);
3604+
StrnCharToLower (AliasLower, StrLen (AliasLower));
36293605

36303606
if (DeleteAlias) {
36313607
Status = gRT->SetVariable (AliasLower, &gShellAliasGuid, 0, 0, NULL);

0 commit comments

Comments
 (0)