]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel3CommandsLib/Cls.c
ShellPkg: Standardized HP Copyright Message String
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel3CommandsLib / Cls.c
index 019aaf723179efd2724940b5fa919e6e208e1d55..61b9ef854e5c532732cc28f2730595f75cad6935 100644 (file)
@@ -1,7 +1,8 @@
 /** @file\r
   Main file for attrib shell level 2 function.\r
 \r
-  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved. <BR>\r
+  (C) Copyright 2015 Hewlett-Packard Development Company, L.P.<BR>\r
+  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -29,21 +30,18 @@ ShellCommandRunCls (
 {\r
   EFI_STATUS    Status;\r
   LIST_ENTRY    *Package;\r
-  CHAR16        *Message;\r
   UINTN         Background;\r
   UINTN         ForeColor;\r
   CHAR16        *ProblemParam;\r
   SHELL_STATUS  ShellStatus;\r
   CONST CHAR16  *Param1;\r
 \r
-  ShellStatus   = SHELL_SUCCESS;\r
-  ProblemParam  = NULL;\r
-  Background    = 0;\r
-\r
   //\r
   // Initialize variables\r
   //\r
-  Message = NULL;\r
+  ShellStatus   = SHELL_SUCCESS;\r
+  ProblemParam  = NULL;\r
+  Background    = 0;\r
 \r
   //\r
   // initialize the shell lib (we must be in non-auto-init...)\r
@@ -57,7 +55,7 @@ ShellCommandRunCls (
   Status = ShellCommandLineParse (EmptyParamList, &Package, &ProblemParam, TRUE);\r
   if (EFI_ERROR(Status)) {\r
     if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {\r
-      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, ProblemParam);\r
+      ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, L"cls", ProblemParam);  \r
       FreePool(ProblemParam);\r
       ShellStatus = SHELL_INVALID_PARAMETER;\r
     } else {\r
@@ -80,14 +78,14 @@ ShellCommandRunCls (
         //\r
         gST->ConOut->ClearScreen (gST->ConOut);\r
       } else if (ShellCommandLineGetCount(Package) > 2) {\r
-        ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle);\r
+        ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY), gShellLevel3HiiHandle, L"cls");  \r
         ShellStatus = SHELL_INVALID_PARAMETER;\r
       } else {\r
-        if (StrDecimalToUintn(Param1) > 7 || StrLen(Param1) > 1 || !ShellIsDecimalDigitCharacter(*Param1)) {\r
-          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel3HiiHandle, Param1);\r
+        if (ShellStrToUintn(Param1) > 7 || StrLen(Param1) > 1 || !ShellIsDecimalDigitCharacter(*Param1)) {\r
+          ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV), gShellLevel3HiiHandle, L"cls", Param1);  \r
           ShellStatus = SHELL_INVALID_PARAMETER;\r
         } else {\r
-          switch (StrDecimalToUintn(Param1)) {\r
+          switch (ShellStrToUintn(Param1)) {\r
             case 0:\r
               Background = EFI_BACKGROUND_BLACK;\r
               break;\r
@@ -113,8 +111,8 @@ ShellCommandRunCls (
               Background = EFI_BACKGROUND_LIGHTGRAY;\r
               break;\r
           }\r
-          ForeColor = (~StrDecimalToUintn(Param1)) & 0xF;\r
-          Status = gST->ConOut->SetAttribute (gST->ConOut, ForeColor | Background);\r
+          ForeColor = (~ShellStrToUintn(Param1)) & 0xF;\r
+          Status = gST->ConOut->SetAttribute (gST->ConOut, (ForeColor | Background) & 0x7F );\r
           ASSERT_EFI_ERROR(Status);\r
           Status = gST->ConOut->ClearScreen (gST->ConOut);\r
           ASSERT_EFI_ERROR(Status);\r