summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c15
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.unibin111846 -> 112254 bytes
2 files changed, 13 insertions, 2 deletions
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
index ae36807958..8fc263f6ba 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
@@ -224,12 +224,23 @@ CopySingleFile(
ASSERT(Buffer != NULL);
while (ReadSize == PcdGet32(PcdShellFileOperationSize) && !EFI_ERROR(Status)) {
Status = ShellReadFile(SourceHandle, &ReadSize, Buffer);
- Status = ShellWriteFile(DestHandle, &ReadSize, Buffer);
+ if (!EFI_ERROR(Status)) {
+ Status = ShellWriteFile(DestHandle, &ReadSize, Buffer);
+ if (EFI_ERROR(Status)) {
+ ShellStatus = (SHELL_STATUS) (Status & (~MAX_BIT));
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_WRITE_ERROR), gShellLevel2HiiHandle, Dest);
+ break;
+ }
+ } else {
+ ShellStatus = (SHELL_STATUS) (Status & (~MAX_BIT));
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_READ_ERROR), gShellLevel2HiiHandle, Source);
+ break;
+ }
}
}
SHELL_FREE_NON_NULL(DestVolumeInfo);
}
-
+
//
// close files
//
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni
index f0991507c4..a64091591e 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.uni
Binary files differ