summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-23 15:34:23 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-08-23 15:34:23 +0000
commit5d46f17ba795ecba56ed73538961ecc013c98376 (patch)
tree56ad7b1a6af8686848f9511c03773032adb13d99 /ShellPkg
parentd159ab9538f5fa7e88fec320811e8da2247438f8 (diff)
downloadedk2-platforms-5d46f17ba795ecba56ed73538961ecc013c98376.tar.xz
ShellPkg: fix ShellPrint-functions to allow for escape character to prevent attribute changes.
This allows for the editors to function easily. signed-off-by: jcarsey reviewed-by: kidzyoung git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12187 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c58
1 files changed, 33 insertions, 25 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
index 3c1b983a60..e824895cdb 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
@@ -2674,32 +2674,40 @@ InternalShellPrintWorker(
// update the attribute
//
if (ResumeLocation != NULL) {
- switch (*(ResumeLocation+1)) {
- case (L'N'):
- gST->ConOut->SetAttribute(gST->ConOut, OriginalAttribute);
- break;
- case (L'E'):
- gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_YELLOW, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
- break;
- case (L'H'):
- gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_WHITE, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
- break;
- case (L'B'):
- gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_BLUE, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
- break;
- case (L'V'):
- gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_GREEN, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
- break;
- default:
- //
- // Print a simple '%' symbol
- //
- Status = InternalPrintTo(L"%");
- if (EFI_ERROR(Status)) {
+ if (*(ResumeLocation-1) == L'^') {
+ //
+ // Print a simple '%' symbol
+ //
+ Status = InternalPrintTo(L"%");
+ ResumeLocation = ResumeLocation - 1;
+ } else {
+ switch (*(ResumeLocation+1)) {
+ case (L'N'):
+ gST->ConOut->SetAttribute(gST->ConOut, OriginalAttribute);
break;
- }
- ResumeLocation = ResumeLocation - 1;
- break;
+ case (L'E'):
+ gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_YELLOW, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
+ break;
+ case (L'H'):
+ gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_WHITE, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
+ break;
+ case (L'B'):
+ gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_BLUE, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
+ break;
+ case (L'V'):
+ gST->ConOut->SetAttribute(gST->ConOut, EFI_TEXT_ATTR(EFI_GREEN, ((OriginalAttribute&(BIT4|BIT5|BIT6))>>4)));
+ break;
+ default:
+ //
+ // Print a simple '%' symbol
+ //
+ Status = InternalPrintTo(L"%");
+ if (EFI_ERROR(Status)) {
+ break;
+ }
+ ResumeLocation = ResumeLocation - 1;
+ break;
+ }
}
} else {
//