X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellLevel3CommandsLib%2FCls.c;h=61b9ef854e5c532732cc28f2730595f75cad6935;hp=dec24776ff53033e97dfafeceb55f65f94547d12;hb=c011b6c9e2baf57fc0557117e9875ceb3dca55a3;hpb=345cd2357af44872b2037f48ce63b05827cfa6c0 diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c b/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c index dec24776ff..61b9ef854e 100644 --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c @@ -1,7 +1,8 @@ /** @file Main file for attrib shell level 2 function. - Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
+ (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
+ Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -29,21 +30,18 @@ ShellCommandRunCls ( { EFI_STATUS Status; LIST_ENTRY *Package; - CHAR16 *Message; UINTN Background; UINTN ForeColor; CHAR16 *ProblemParam; SHELL_STATUS ShellStatus; CONST CHAR16 *Param1; - ShellStatus = SHELL_SUCCESS; - ProblemParam = NULL; - Background = 0; - // // Initialize variables // - Message = NULL; + ShellStatus = SHELL_SUCCESS; + ProblemParam = NULL; + Background = 0; // // initialize the shell lib (we must be in non-auto-init...) @@ -57,7 +55,7 @@ ShellCommandRunCls ( Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE); if (EFI_ERROR(Status)) { if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"cls", ProblemParam); FreePool(ProblemParam); ShellStatus = SHELL_INVALID_PARAMETER; } else { @@ -80,11 +78,11 @@ ShellCommandRunCls ( // gST->ConOut->ClearScreen (gST->ConOut); } else if (ShellCommandLineGetCount(Package) > 2) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"cls"); ShellStatus = SHELL_INVALID_PARAMETER; } else { if (ShellStrToUintn(Param1) > 7 || StrLen(Param1) > 1 || !ShellIsDecimalDigitCharacter(*Param1)) { - ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, Param1); + ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel3HiiHandle, L"cls", Param1); ShellStatus = SHELL_INVALID_PARAMETER; } else { switch (ShellStrToUintn(Param1)) { @@ -114,7 +112,7 @@ ShellCommandRunCls ( break; } ForeColor = (~ShellStrToUintn(Param1)) & 0xF; - Status = gST->ConOut->SetAttribute (gST->ConOut, ForeColor | Background); + Status = gST->ConOut->SetAttribute (gST->ConOut, (ForeColor | Background) & 0x7F ); ASSERT_EFI_ERROR(Status); Status = gST->ConOut->ClearScreen (gST->ConOut); ASSERT_EFI_ERROR(Status);