summaryrefslogtreecommitdiff
path: root/ShellPkg/Application
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Application')
-rw-r--r--ShellPkg/Application/Shell/Shell.c14
-rw-r--r--ShellPkg/Application/Shell/Shell.inf1
-rw-r--r--ShellPkg/Application/Shell/ShellEnvVar.c30
-rw-r--r--ShellPkg/Application/Shell/ShellProtocol.c13
4 files changed, 28 insertions, 30 deletions
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c
index 9bacf9d..ae3e943 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -395,11 +395,7 @@ UefiMain (
//
// Check PCDs for optional features that are not implemented yet.
//
- if ( PcdGetBool (PcdShellSupportOldProtocols)
- || !FeaturePcdGet (PcdShellRequireHiiPlatform)
- || FeaturePcdGet (PcdShellSupportFrameworkHii)
- )
- {
+ if (!FeaturePcdGet (PcdShellRequireHiiPlatform) || FeaturePcdGet (PcdShellSupportFrameworkHii)) {
return (EFI_UNSUPPORTED);
}
@@ -1266,9 +1262,11 @@ LocateStartupScript (
InternalEfiShellSetEnv (L"homefilesystem", StartupScriptPath, TRUE);
- StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, ((FILEPATH_DEVICE_PATH *)FileDevicePath)->PathName, 0);
- PathRemoveLastItem (StartupScriptPath);
- StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, mStartupScript, 0);
+ if ((DevicePathType (FileDevicePath) == MEDIA_DEVICE_PATH) && (DevicePathSubType (FileDevicePath) == MEDIA_FILEPATH_DP)) {
+ StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, ((FILEPATH_DEVICE_PATH *)FileDevicePath)->PathName, 0);
+ PathRemoveLastItem (StartupScriptPath);
+ StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, mStartupScript, 0);
+ }
}
//
diff --git a/ShellPkg/Application/Shell/Shell.inf b/ShellPkg/Application/Shell/Shell.inf
index f1e41de..5a7492c 100644
--- a/ShellPkg/Application/Shell/Shell.inf
+++ b/ShellPkg/Application/Shell/Shell.inf
@@ -93,7 +93,6 @@
[Pcd]
gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel ## CONSUMES
- gEfiShellPkgTokenSpaceGuid.PcdShellSupportOldProtocols ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellRequireHiiPlatform ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellSupportFrameworkHii ## CONSUMES
gEfiShellPkgTokenSpaceGuid.PcdShellPageBreakDefault ## CONSUMES
diff --git a/ShellPkg/Application/Shell/ShellEnvVar.c b/ShellPkg/Application/Shell/ShellEnvVar.c
index b97cfe9..9e84d7f 100644
--- a/ShellPkg/Application/Shell/ShellEnvVar.c
+++ b/ShellPkg/Application/Shell/ShellEnvVar.c
@@ -285,19 +285,23 @@ SetEnvironmentVariableList (
//
// set all the variables from the list
//
- for ( Node = (ENV_VAR_LIST *)GetFirstNode (ListHead)
- ; !IsNull (ListHead, &Node->Link)
- ; Node = (ENV_VAR_LIST *)GetNextNode (ListHead, &Node->Link)
- )
- {
- Size = StrSize (Node->Val) - sizeof (CHAR16);
- if (Node->Atts & EFI_VARIABLE_NON_VOLATILE) {
- Status = SHELL_SET_ENVIRONMENT_VARIABLE_NV (Node->Key, Size, Node->Val);
- } else {
- Status = SHELL_SET_ENVIRONMENT_VARIABLE_V (Node->Key, Size, Node->Val);
- }
+ if ((ListHead != NULL) && !IsListEmpty (ListHead)) {
+ for ( Node = (ENV_VAR_LIST *)GetFirstNode (ListHead)
+ ; !IsNull (ListHead, &Node->Link)
+ ; Node = (ENV_VAR_LIST *)GetNextNode (ListHead, &Node->Link)
+ )
+ {
+ if ((Node->Key != NULL) && (Node->Val != NULL)) {
+ Size = StrSize (Node->Val) - sizeof (CHAR16);
+ if (Node->Atts & EFI_VARIABLE_NON_VOLATILE) {
+ Status = SHELL_SET_ENVIRONMENT_VARIABLE_NV (Node->Key, Size, Node->Val);
+ } else {
+ Status = SHELL_SET_ENVIRONMENT_VARIABLE_V (Node->Key, Size, Node->Val);
+ }
- ASSERT_EFI_ERROR (Status);
+ ASSERT_EFI_ERROR (Status);
+ }
+ }
}
FreeEnvironmentVariableList (ListHead);
@@ -441,7 +445,7 @@ ShellFindEnvVarInList (
; Node = (ENV_VAR_LIST *)GetNextNode (&gShellEnvVarList.Link, &Node->Link)
)
{
- if ((Node->Key != NULL) && (StrCmp (Key, Node->Key) == 0)) {
+ if ((Node->Key != NULL) && (StrCmp (Key, Node->Key) == 0) && (Node->Val != NULL)) {
*Value = AllocateCopyPool (StrSize (Node->Val), Node->Val);
*ValueSize = StrSize (Node->Val);
if (Atts != NULL) {
diff --git a/ShellPkg/Application/Shell/ShellProtocol.c b/ShellPkg/Application/Shell/ShellProtocol.c
index ff53f6b..646294d 100644
--- a/ShellPkg/Application/Shell/ShellProtocol.c
+++ b/ShellPkg/Application/Shell/ShellProtocol.c
@@ -1624,8 +1624,6 @@ InternalShellExecuteDevicePath (
Status = gBS->InstallProtocolInterface (&NewHandle, &gEfiShellParametersProtocolGuid, EFI_NATIVE_INTERFACE, &ShellParamsProtocol);
ASSERT_EFI_ERROR (Status);
- /// @todo initialize and install ShellInterface protocol on the new image for compatibility if - PcdGetBool(PcdShellSupportOldProtocols)
-
//
// now start the image and if the caller wanted the return code pass it to them...
//
@@ -2855,7 +2853,11 @@ EfiShellGetEnvEx (
; Node = (ENV_VAR_LIST *)GetNextNode (&gShellEnvVarList.Link, &Node->Link)
)
{
- ASSERT (Node->Key != NULL);
+ if (Node->Key == NULL) {
+ ASSERT (FALSE);
+ continue;
+ }
+
Size += StrSize (Node->Key);
}
@@ -3889,11 +3891,6 @@ CreatePopulateInstallShellProtocol (
);
}
- if (PcdGetBool (PcdShellSupportOldProtocols)) {
- /// @todo support ShellEnvironment2
- /// @todo do we need to support ShellEnvironment (not ShellEnvironment2) also?
- }
-
if (!EFI_ERROR (Status)) {
*NewShell = &mShellProtocol;
}