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/UefiShellLib/UefiShellLib.c | |
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/UefiShellLib/UefiShellLib.c')
-rw-r--r-- | ShellPkg/Library/UefiShellLib/UefiShellLib.c | 57 |
1 files changed, 43 insertions, 14 deletions
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);
|