ShellPkg: Fix 'EfiShellExecute' doesn't get command status correctly.

1. Add a new  function 'RunShellCommand' to return command status, thus 'EfiShellExecute' can get the command return status of 'CommandLine'.
2. Refine the code logic of 'EfiShellExecute' to make the new image of shell be loaded only if  'Environment' isn't NULL.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Signed-off-by: Jin Eric <eric.jin@intel.com>
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18664 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Qiu Shumin
2015-10-26 13:28:01 +00:00
committed by shenshushi
parent c2305a4af8
commit 490ce43d92
4 changed files with 125 additions and 40 deletions

View File

@ -339,9 +339,10 @@ SetEnvironmentVariables(
//
// Copy the string into the Key, leaving the last character allocated as NULL to terminate
//
StrCpyS( Node->Key,
StrnCpyS( Node->Key,
StrStr(CurrentString, L"=") - CurrentString + 1,
CurrentString
CurrentString,
StrStr(CurrentString, L"=") - CurrentString
);
//