mirror of https://github.com/acidanthera/audk.git
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
This commit is contained in:
parent
0c956e0ddb
commit
b2bf973586
|
@ -603,22 +603,25 @@ ShellCommandRunCp (
|
||||||
}
|
}
|
||||||
Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, LoopCounter), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
|
Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, LoopCounter), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
|
||||||
if (EFI_ERROR(Status) || FileList == NULL || IsListEmpty(&FileList->Link)) {
|
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;
|
ShellStatus = SHELL_NOT_FOUND;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//
|
if (ShellStatus != SHELL_SUCCESS) {
|
||||||
// now copy them all...
|
|
||||||
//
|
|
||||||
if (FileList != NULL && !IsListEmpty(&FileList->Link)) {
|
|
||||||
ShellStatus = ProcessValidateAndCopyFiles(FileList, ShellCommandCleanPath((CHAR16*)ShellCommandLineGetRawValue(Package, ParamCount)), SilentMode, RecursiveMode);
|
|
||||||
Status = ShellCloseFileMetaArg(&FileList);
|
Status = ShellCloseFileMetaArg(&FileList);
|
||||||
if (EFI_ERROR(Status) && ShellStatus == SHELL_SUCCESS) {
|
} else {
|
||||||
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_FILE), gShellLevel2HiiHandle, ShellCommandLineGetRawValue(Package, 1), ShellStatus|MAX_BIT);
|
//
|
||||||
ShellStatus = SHELL_ACCESS_DENIED;
|
// 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;
|
break;
|
||||||
} // switch on parameter count
|
} // switch on parameter count
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue