summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellLevel2CommandsLib
diff options
context:
space:
mode:
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-30 21:37:01 +0000
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-30 21:37:01 +0000
commitb2bf9735860994b4f4ae3904fd784bedcdd26da1 (patch)
treedd91c9663e47a875578b81fc3bbc0ca6365fa477 /ShellPkg/Library/UefiShellLevel2CommandsLib
parent0c956e0ddbb1c2fb13f8c9cd1a42273a66a46cb4 (diff)
downloadedk2-platforms-b2bf9735860994b4f4ae3904fd784bedcdd26da1.tar.xz
fix for the cp shell command - halt when an error was encountered and also fix the error message displayed.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11462 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'ShellPkg/Library/UefiShellLevel2CommandsLib')
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
index d71a23cb73..d09d2ec7a7 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
@@ -603,22 +603,25 @@ ShellCommandRunCp (
}
Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, LoopCounter), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
if (EFI_ERROR(Status) || FileList == NULL || IsListEmpty(&FileList->Link)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, 1));
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, LoopCounter));
ShellStatus = SHELL_NOT_FOUND;
}
}
- //
- // now copy them all...
- //
- if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
- ShellStatus = ProcessValidateAndCopyFiles(FileList, ShellCommandCleanPath((CHAR16*)ShellCommandLineGetRawValue(Package, ParamCount)), SilentMode, RecursiveMode);
+ if (ShellStatus != SHELL_SUCCESS) {
Status = ShellCloseFileMetaArg(&FileList);
- if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_FILE), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, 1), ShellStatus|MAX_BIT);
- ShellStatus = SHELL_ACCESS_DENIED;
+ } else {
+ //
+ // now copy them all...
+ //
+ if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
+ ShellStatus = ProcessValidateAndCopyFiles(FileList, ShellCommandCleanPath((CHAR16*)ShellCommandLineGetRawValue(Package, ParamCount)), SilentMode, RecursiveMode);
+ Status = ShellCloseFileMetaArg(&FileList);
+ if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_FILE), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, ParamCount), ShellStatus|MAX_BIT);
+ ShellStatus = SHELL_ACCESS_DENIED;
+ }
}
}
-
break;
} // switch on parameter count