mirror of https://github.com/acidanthera/audk.git
ShellPkg: fix Comp command output
The comp command was potentially displaying the incorrect offset into the file due to comparing 3 extra bytes for difference groups. 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@15558 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
4ab4497c38
commit
33eb033f86
|
@ -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
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue