ShellPkg: Fix calls to SimpleTextOut->SetAttribute to not use reserved bits

As the shell inverts foreground and background it needs to be sure that it properly masks off the reserved bits and this is important since the foreground and background are not the same numbers of bits.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <Jaben.carsey@intel.com>
Reviewed-by: Tapan Shah <tapandshah@hp.com>
Reviewed-by: Erik Bjorge <erik.c.bjorge@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15681 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Jaben Carsey
2014-07-25 18:46:23 +00:00
committed by jcarsey
parent 6cb9566f26
commit 17e59b3346
6 changed files with 31 additions and 31 deletions

View File

@ -1,7 +1,7 @@
/** @file
Main file for attrib shell level 2 function.
Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved. <BR>
Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. <BR>
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
@ -111,7 +111,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);