summaryrefslogtreecommitdiff
path: root/ShellPkg
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c29
1 files changed, 20 insertions, 9 deletions
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c
index 01ef1997b2..f4e20a4e3a 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Comp.c
@@ -1,7 +1,7 @@
/** @file
Main file for Comp shell Debug1 function.
- Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 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
@@ -50,6 +50,7 @@ ShellCommandRunComp (
CHAR16 *FileName1;
CHAR16 *FileName2;
CONST CHAR16 *TempParam;
+ UINTN ErrorAddress;
ErrorCount = 0;
ShellStatus = SHELL_SUCCESS;
@@ -136,12 +137,18 @@ ShellCommandRunComp (
Status = gEfiShellProtocol->ReadFile(FileHandle2, &DataSizeFromFile2, &DataFromFile2);
ASSERT_EFI_ERROR(Status);
if (DataFromFile1 != DataFromFile2) {
+ ErrorAddress = LoopVar;
ADF_File11 = 0;
ADF_File12 = 0;
ADF_File13 = 0;
ADF_File21 = 0;
ADF_File22 = 0;
ADF_File23 = 0;
+
+ //
+ // Now check the next 3 bytes if possible. This will make output
+ // cleaner when there are a sequence of differences.
+ //
if (LoopVar + 1 < Size1) {
LoopVar++;
DataSizeFromFile1 = 1;
@@ -169,6 +176,10 @@ ShellCommandRunComp (
}
}
}
+
+ //
+ // Print out based on highest of the 4 bytes that are different.
+ //
if (ADF_File13 != ADF_File23) {
ShellPrintHiiEx(
-1,
@@ -178,11 +189,11 @@ ShellCommandRunComp (
gShellDebug1HiiHandle,
++ErrorCount,
FileName1,
- LoopVar,
+ ErrorAddress,
DataFromFile1, ADF_File11, ADF_File12, ADF_File13,
DataFromFile1, ADF_File11, ADF_File12, ADF_File13,
FileName2,
- LoopVar,
+ ErrorAddress,
DataFromFile2, ADF_File21, ADF_File22, ADF_File23,
DataFromFile2, ADF_File21, ADF_File22, ADF_File23
);
@@ -195,11 +206,11 @@ ShellCommandRunComp (
gShellDebug1HiiHandle,
++ErrorCount,
FileName1,
- LoopVar,
+ ErrorAddress,
DataFromFile1, ADF_File11, ADF_File12,
DataFromFile1, ADF_File11, ADF_File12,
FileName2,
- LoopVar,
+ ErrorAddress,
DataFromFile2, ADF_File21, ADF_File22,
DataFromFile2, ADF_File21, ADF_File22
);
@@ -212,11 +223,11 @@ ShellCommandRunComp (
gShellDebug1HiiHandle,
++ErrorCount,
FileName1,
- LoopVar,
+ ErrorAddress,
DataFromFile1, ADF_File11,
DataFromFile1, ADF_File11,
FileName2,
- LoopVar,
+ ErrorAddress,
DataFromFile2, ADF_File21,
DataFromFile2, ADF_File21
);
@@ -229,11 +240,11 @@ ShellCommandRunComp (
gShellDebug1HiiHandle,
++ErrorCount,
FileName1,
- LoopVar,
+ ErrorAddress,
DataFromFile1,
DataFromFile1,
FileName2,
- LoopVar,
+ ErrorAddress,
DataFromFile2,
DataFromFile2
);