diff options
author | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-07-08 17:26:58 +0000 |
---|---|---|
committer | jcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524> | 2009-07-08 17:26:58 +0000 |
commit | 9eb53ac3456f79fe107d7daf3e849c008375a28e (patch) | |
tree | ddb4a29f8f2d6295492389318086074ee51a1784 /ShellPkg/Library | |
parent | ee33873da11165f30c86fe1cd04371373d525968 (diff) | |
download | edk2-platforms-9eb53ac3456f79fe107d7daf3e849c008375a28e.tar.xz |
fixing build errors
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@8824 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library')
-rw-r--r-- | ShellPkg/Library/BaseFileHandleLib/BaseFileHandleLib.c | 8 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c | 2 | ||||
-rw-r--r-- | ShellPkg/Library/UefiShellLib/UefiShellLib.c | 57 |
3 files changed, 48 insertions, 19 deletions
diff --git a/ShellPkg/Library/BaseFileHandleLib/BaseFileHandleLib.c b/ShellPkg/Library/BaseFileHandleLib/BaseFileHandleLib.c index 9136b9c200..d04a797bdf 100644 --- a/ShellPkg/Library/BaseFileHandleLib/BaseFileHandleLib.c +++ b/ShellPkg/Library/BaseFileHandleLib/BaseFileHandleLib.c @@ -714,7 +714,7 @@ StrnCatGrowLeft ( *Destination = AllocateZeroPool((Count+1)*sizeof(CHAR16));
}
- *Destination = CopyMem(*Destination+StrLen(Source), *Destination, StrSize(*Destination));
+ *Destination = CopyMem((*Destination)+StrLen(Source), *Destination, StrSize(*Destination));
*Destination = CopyMem(*Destination, Source, StrLen(Source));
return (*Destination);
}
@@ -798,7 +798,7 @@ FileHandleGetFileName ( }
if (EFI_ERROR(Status) && *FullFileName != NULL) {
- FreePool(FullFileName);
+ FreePool(*FullFileName);
}
return (Status);
@@ -808,8 +808,8 @@ FileHandleGetFileName ( Function to read a single line (up to but not including the \n) from a file.
@param[in] Handle FileHandle to read from
- @param[in,out] Buffer pointer to buffer to read into
- @param[in,out] Size pointer to number of bytes in buffer
+ @param[in,out] Buffer pointer to buffer to read into
+ @param[in,out] Size pointer to number of bytes in buffer
@param[in[ Truncate if TRUE then allows for truncation of the line to fit.
if FALSE will reset the position to the begining of the
line if the buffer is not large enough.
diff --git a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c b/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c index 43d429e6a5..80f56c0014 100644 --- a/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c +++ b/ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.c @@ -50,7 +50,7 @@ ShellCEntryLib ( IN EFI_SYSTEM_TABLE *SystemTable
)
{
- INT32 ReturnFromMain;
+ INTN ReturnFromMain;
EFI_SHELL_PARAMETERS_PROTOCOL *EfiShellParametersProtocol;
EFI_SHELL_INTERFACE *EfiShellInterface;
EFI_STATUS Status;
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/UefiShellLib/UefiShellLib.c index 20805725fc..7b7533a327 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -79,9 +79,7 @@ ShellFindSE2 ( //
// look for the mEfiShellEnvironment2 protocol at a higher level
//
- if (EFI_ERROR (Status) || !(CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid) != FALSE &&
- (mEfiShellEnvironment2->MajorVersion > EFI_SHELL_MAJOR_VER ||
- (mEfiShellEnvironment2->MajorVersion == EFI_SHELL_MAJOR_VER && mEfiShellEnvironment2->MinorVersion >= EFI_SHELL_MINOR_VER)))) {
+ if (EFI_ERROR (Status) || !(CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid) != FALSE)){
//
// figure out how big of a buffer we need.
//
@@ -113,9 +111,7 @@ ShellFindSE2 ( NULL,
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
- if (CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid) != FALSE &&
- (mEfiShellEnvironment2->MajorVersion > EFI_SHELL_MAJOR_VER ||
- (mEfiShellEnvironment2->MajorVersion == EFI_SHELL_MAJOR_VER && mEfiShellEnvironment2->MinorVersion >= EFI_SHELL_MINOR_VER))) {
+ if (CompareGuid (&mEfiShellEnvironment2->SESGuid, &gEfiShellEnvironment2ExtGuid) != FALSE) {
mEfiShellEnvironment2Handle = Buffer[HandleIndex];
Status = EFI_SUCCESS;
break;
@@ -1484,9 +1480,13 @@ InternalIsOnCheckList ( //
for (TempListItem = (SHELL_PARAM_ITEM*)CheckList ; TempListItem->Name != NULL ; TempListItem++) {
//
- // If the Name matches set the type and return TRUE
+ // If the Type is TypeStart only check the first characters of the passed in param
+ // If it matches set the type and return TRUE
//
- if (StrCmp(Name, TempListItem->Name) == 0) {
+ if (TempListItem->Type == TypeStart && StrnCmp(Name, TempListItem->Name, StrLen(TempListItem->Name)) == 0) {
+ *Type = TempListItem->Type;
+ return (TRUE);
+ } else if (StrCmp(Name, TempListItem->Name) == 0) {
*Type = TempListItem->Type;
return (TRUE);
}
@@ -1767,7 +1767,10 @@ ShellCommandLineFreeVarList ( //
// for each node in the list
//
- for (Node = GetFirstNode(CheckPackage); Node != CheckPackage ; Node = GetFirstNode(CheckPackage)) {
+ for ( Node = GetFirstNode(CheckPackage)
+ ; Node != CheckPackage
+ ; Node = GetFirstNode(CheckPackage)
+ ){
//
// Remove it from the list
//
@@ -1835,12 +1838,22 @@ ShellCommandLineGetFlag ( //
// enumerate through the list of parametrs
//
- for (Node = GetFirstNode(CheckPackage) ; !IsNull (CheckPackage, Node) ; Node = GetNextNode(CheckPackage, Node) ) {
+ for ( Node = GetFirstNode(CheckPackage)
+ ; !IsNull (CheckPackage, Node)
+ ; Node = GetNextNode(CheckPackage, Node)
+ ){
//
// If the Name matches, return TRUE (and there may be NULL name)
//
if (((SHELL_PARAM_PACKAGE*)Node)->Name != NULL) {
- if (StrCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {
+ //
+ // If Type is TypeStart then only compare the begining of the strings
+ //
+ if ( ((SHELL_PARAM_PACKAGE*)Node)->Type == TypeStart
+ && StrnCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name, StrLen(KeyString)) == 0
+ ){
+ return (TRUE);
+ } else if (StrCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {
return (TRUE);
}
}
@@ -1879,12 +1892,28 @@ ShellCommandLineGetValue ( //
// enumerate through the list of parametrs
//
- for (Node = GetFirstNode(CheckPackage) ; !IsNull (CheckPackage, Node) ; Node = GetNextNode(CheckPackage, Node) ) {
+ for ( Node = GetFirstNode(CheckPackage)
+ ; !IsNull (CheckPackage, Node)
+ ; Node = GetNextNode(CheckPackage, Node)
+ ){
//
// If the Name matches, return the value (name can be NULL)
//
if (((SHELL_PARAM_PACKAGE*)Node)->Name != NULL) {
- if (StrCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {
+ //
+ // If Type is TypeStart then only compare the begining of the strings
+ //
+ if ( ((SHELL_PARAM_PACKAGE*)Node)->Type == TypeStart
+ && StrnCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name, StrLen(KeyString)) == 0
+ ){
+ //
+ // return the string part after the flag
+ //
+ return (((SHELL_PARAM_PACKAGE*)Node)->Name + StrLen(KeyString));
+ } else if (StrCmp(KeyString, ((SHELL_PARAM_PACKAGE*)Node)->Name) == 0) {
+ //
+ // return the value
+ //
return (((SHELL_PARAM_PACKAGE*)Node)->Value);
}
}
@@ -1981,7 +2010,7 @@ CopyReplace( while (*SourceString != L'\0') {
if (StrnCmp(SourceString, FindTarget, StrLen(FindTarget)) == 0) {
SourceString += StrLen(FindTarget);
- if (StrSize(NewString) + (StrLen(ReplaceWith)*sizeof(CHAR16)) > NewSize) {
+ if ((StrSize(NewString) + (StrLen(ReplaceWith)*sizeof(CHAR16))) > NewSize) {
return (EFI_BUFFER_TOO_SMALL);
}
StrCat(NewString, ReplaceWith);
|