diff options
Diffstat (limited to 'ShellPkg/Application/Shell/Shell.c')
-rw-r--r-- | ShellPkg/Application/Shell/Shell.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shell/Shell.c index aa4dfd37ab..35ffae8e9c 100644 --- a/ShellPkg/Application/Shell/Shell.c +++ b/ShellPkg/Application/Shell/Shell.c @@ -1310,6 +1310,7 @@ RunCommand( )
{
EFI_STATUS Status;
+ EFI_STATUS StatusCode;
CHAR16 *CommandName;
SHELL_STATUS ShellStatus;
UINTN Argc;
@@ -1557,11 +1558,26 @@ RunCommand( DevPath,
PostVariableCmdLine,
NULL,
- NULL
+ &StatusCode
);
+
+ //
+ // Updatet last error status.
+ //
+ UnicodeSPrint(LeString, sizeof(LeString)*sizeof(LeString[0]), L"0x%08x", StatusCode);
+ DEBUG_CODE(InternalEfiShellSetEnv(L"DebugLasterror", LeString, TRUE););
+ InternalEfiShellSetEnv(L"Lasterror", LeString, TRUE);
}
}
}
+
+ //
+ // Print some error info.
+ //
+ if (EFI_ERROR(Status)) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_ERROR), ShellInfoObject.HiiHandle, (VOID*)(Status));
+ }
+
CommandName = StrnCatGrow(&CommandName, NULL, ShellInfoObject.NewShellParametersProtocol->Argv[0], 0);
RestoreArgcArgv(ShellInfoObject.NewShellParametersProtocol, &Argv, &Argc);
|