summaryrefslogtreecommitdiff
path: root/ShellPkg/Application/Shell/Shell.c
diff options
context:
space:
mode:
Diffstat (limited to 'ShellPkg/Application/Shell/Shell.c')
-rw-r--r--ShellPkg/Application/Shell/Shell.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c
index 483fe4d..ae3e943 100644
--- a/ShellPkg/Application/Shell/Shell.c
+++ b/ShellPkg/Application/Shell/Shell.c
@@ -1262,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);
+ }
}
//