X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellLevel2CommandsLib%2FCp.c;h=eb1f3b65a3a1fead2250b11d7c408e8dd8365847;hb=0b34dc1324e07d330efea50222bf399a860bdbd9;hp=52c1de8a96644f10fc2b17d3a33f0c490096f183;hpb=0960ba17e596812f211ba334cc6699d45bada328;p=mirror_edk2.git
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
index 52c1de8a96..eb1f3b65a3 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
@@ -1,7 +1,8 @@
/** @file
Main file for cp shell level 2 function.
- Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.
+ (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
+ Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -52,6 +53,7 @@ ValidateAndCopyFiles(
@param[in] Dest pointer to destination file name
@param[out] Resp pointer to response from question. Pass back on looped calling
@param[in] SilentMode whether to run in quiet mode or not
+ @param[in] CmdName Source command name requesting single file copy
@retval SHELL_SUCCESS The source file was copied to the destination
**/
@@ -61,7 +63,8 @@ CopySingleFile(
IN CONST CHAR16 *Source,
IN CONST CHAR16 *Dest,
OUT VOID **Resp,
- IN BOOLEAN SilentMode
+ IN BOOLEAN SilentMode,
+ IN CONST CHAR16 *CmdName
)
{
VOID *Response;
@@ -131,7 +134,7 @@ CopySingleFile(
if (ShellIsDirectory(Source) == EFI_SUCCESS) {
Status = ShellCreateDirectory(Dest, &DestHandle);
if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_DIR_FAIL), gShellLevel2HiiHandle, Dest);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_DIR_FAIL), gShellLevel2HiiHandle, CmdName, Dest);
return (SHELL_ACCESS_DENIED);
}
@@ -160,15 +163,18 @@ CopySingleFile(
//
Status = ShellOpenFileByName(Dest, &DestHandle, EFI_FILE_MODE_READ|EFI_FILE_MODE_WRITE|EFI_FILE_MODE_CREATE, 0);
if (EFI_ERROR(Status)) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_OPEN_FAIL), gShellLevel2HiiHandle, Dest);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_OPEN_FAIL), gShellLevel2HiiHandle, CmdName, Dest);
return (SHELL_ACCESS_DENIED);
}
//
// open source file
//
- Status = ShellOpenFileByName(Source, &SourceHandle, EFI_FILE_MODE_READ, 0);
- ASSERT_EFI_ERROR(Status);
+ Status = ShellOpenFileByName (Source, &SourceHandle, EFI_FILE_MODE_READ, 0);
+ if (EFI_ERROR (Status)) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_CP_SRC_OPEN_FAIL), gShellLevel2HiiHandle, CmdName, Source);
+ return (SHELL_ACCESS_DENIED);
+ }
//
//get file size of source file and freespace available on destination volume
@@ -216,26 +222,29 @@ CopySingleFile(
//not enough space on destination directory to copy file
//
SHELL_FREE_NON_NULL(DestVolumeInfo);
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_FAIL), gShellLevel2HiiHandle);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_FAIL), gShellLevel2HiiHandle, CmdName);
return(SHELL_VOLUME_FULL);
} else {
//
// copy data between files
//
Buffer = AllocateZeroPool(ReadSize);
- ASSERT(Buffer != NULL);
+ if (Buffer == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellLevel2HiiHandle, CmdName);
+ return SHELL_OUT_OF_RESOURCES;
+ }
while (ReadSize == PcdGet32(PcdShellFileOperationSize) && !EFI_ERROR(Status)) {
Status = ShellReadFile(SourceHandle, &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);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_WRITE_ERROR), gShellLevel2HiiHandle, CmdName, Dest);
break;
}
} else {
ShellStatus = (SHELL_STATUS) (Status & (~MAX_BIT));
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_READ_ERROR), gShellLevel2HiiHandle, Source);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_CPY_READ_ERROR), gShellLevel2HiiHandle, CmdName, Source);
break;
}
}
@@ -309,10 +318,11 @@ ValidateAndCopyFiles(
Response = *Resp;
}
- DestPath = NULL;
- ShellStatus = SHELL_SUCCESS;
- PathSize = 0;
- Cwd = ShellGetCurrentDir(NULL);
+ DestPath = NULL;
+ ShellStatus = SHELL_SUCCESS;
+ PathSize = 0;
+ Cwd = ShellGetCurrentDir(NULL);
+ CleanFilePathStr = NULL;
ASSERT(FileList != NULL);
ASSERT(DestDir != NULL);
@@ -325,7 +335,9 @@ ValidateAndCopyFiles(
} else {
return SHELL_INVALID_PARAMETER;
}
- }
+ }
+
+ ASSERT (CleanFilePathStr != NULL);
//
// If we are trying to copy multiple files... make sure we got a directory for the target...
@@ -334,7 +346,7 @@ ValidateAndCopyFiles(
//
// Error for destination not a directory
//
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_DIR), gShellLevel2HiiHandle, CleanFilePathStr);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_DIR), gShellLevel2HiiHandle, L"cp", CleanFilePathStr);
FreePool (CleanFilePathStr);
return (SHELL_INVALID_PARAMETER);
}
@@ -351,7 +363,7 @@ ValidateAndCopyFiles(
NewSize = StrSize(CleanFilePathStr);
NewSize += StrSize(Node->FullName);
- NewSize += (Cwd == NULL)? 0 : StrSize(Cwd);
+ NewSize += (Cwd == NULL)? 0 : (StrSize(Cwd) + sizeof(CHAR16));
if (NewSize > PathSize) {
PathSize = NewSize;
}
@@ -360,7 +372,7 @@ ValidateAndCopyFiles(
// Make sure got -r if required
//
if (!RecursiveMode && !EFI_ERROR(ShellIsDirectory(Node->FullName))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DIR_REQ), gShellLevel2HiiHandle);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DIR_REQ), gShellLevel2HiiHandle, L"cp");
FreePool (CleanFilePathStr);
return (SHELL_INVALID_PARAMETER);
}
@@ -372,7 +384,7 @@ ValidateAndCopyFiles(
//
// Error for destination not a directory
//
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_DIR), gShellLevel2HiiHandle, CleanFilePathStr);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NOT_DIR), gShellLevel2HiiHandle, L"cp", CleanFilePathStr);
FreePool (CleanFilePathStr);
return (SHELL_INVALID_PARAMETER);
}
@@ -418,20 +430,21 @@ ValidateAndCopyFiles(
// simple copy of a single file
//
if (Cwd != NULL) {
- StrnCpy(DestPath, Cwd, PathSize/sizeof(CHAR16)-1);
+ StrCpyS(DestPath, PathSize / sizeof(CHAR16), Cwd);
+ StrCatS(DestPath, PathSize / sizeof(CHAR16), L"\\");
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, CleanFilePathStr);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, L"cp", CleanFilePathStr);
FreePool (CleanFilePathStr);
return (SHELL_INVALID_PARAMETER);
}
if (DestPath[StrLen(DestPath)-1] != L'\\' && CleanFilePathStr[0] != L'\\') {
- StrnCat(DestPath, L"\\", PathSize/sizeof(CHAR16) - StrLen(DestPath) -1);
+ StrCatS(DestPath, PathSize / sizeof(CHAR16), L"\\");
} else if (DestPath[StrLen(DestPath)-1] == L'\\' && CleanFilePathStr[0] == L'\\') {
((CHAR16*)DestPath)[StrLen(DestPath)-1] = CHAR_NULL;
}
- StrnCat(DestPath, CleanFilePathStr, PathSize/sizeof(CHAR16) - StrLen(DestPath) -1);
+ StrCatS(DestPath, PathSize/sizeof(CHAR16), CleanFilePathStr);
} else {
- StrnCpy(DestPath, CleanFilePathStr, PathSize/sizeof(CHAR16) -1);
+ StrCpyS(DestPath, PathSize/sizeof(CHAR16), CleanFilePathStr);
}
} else {
//
@@ -446,52 +459,54 @@ ValidateAndCopyFiles(
// Copy to the root of CWD
//
if (Cwd != NULL) {
- StrnCpy(DestPath, Cwd, PathSize/sizeof(CHAR16) -1);
+ StrCpyS(DestPath, PathSize/sizeof(CHAR16), Cwd);
+ StrCatS(DestPath, PathSize/sizeof(CHAR16), L"\\");
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, CleanFilePathStr);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, L"cp", CleanFilePathStr);
FreePool(CleanFilePathStr);
return (SHELL_INVALID_PARAMETER);
}
while (PathRemoveLastItem(DestPath));
- StrnCat(DestPath, CleanFilePathStr+1, PathSize/sizeof(CHAR16) - StrLen(DestPath) -1);
- StrnCat(DestPath, Node->FileName, PathSize/sizeof(CHAR16) - StrLen(DestPath) -1);
+ StrCatS(DestPath, PathSize/sizeof(CHAR16), CleanFilePathStr+1);
+ StrCatS(DestPath, PathSize/sizeof(CHAR16), Node->FileName);
} else if (StrStr(CleanFilePathStr, L":") == NULL) {
if (Cwd != NULL) {
- StrnCpy(DestPath, Cwd, PathSize/sizeof(CHAR16) -1);
+ StrCpyS(DestPath, PathSize/sizeof(CHAR16), Cwd);
+ StrCatS(DestPath, PathSize/sizeof(CHAR16), L"\\");
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, CleanFilePathStr);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_DIR_NF), gShellLevel2HiiHandle, L"cp", CleanFilePathStr);
FreePool(CleanFilePathStr);
return (SHELL_INVALID_PARAMETER);
}
if (DestPath[StrLen(DestPath)-1] != L'\\' && CleanFilePathStr[0] != L'\\') {
- StrnCat(DestPath, L"\\", PathSize/sizeof(CHAR16) - StrLen(DestPath) -1);
+ StrCatS(DestPath, PathSize/sizeof(CHAR16), L"\\");
} else if (DestPath[StrLen(DestPath)-1] == L'\\' && CleanFilePathStr[0] == L'\\') {
((CHAR16*)DestPath)[StrLen(DestPath)-1] = CHAR_NULL;
}
- StrnCat(DestPath, CleanFilePathStr, PathSize/sizeof(CHAR16) - StrLen(DestPath) -1);
+ StrCatS(DestPath, PathSize/sizeof(CHAR16), CleanFilePathStr);
if (CleanFilePathStr[StrLen(CleanFilePathStr)-1] != L'\\' && Node->FileName[0] != L'\\') {
- StrnCat(DestPath, L"\\", PathSize/sizeof(CHAR16) - StrLen(DestPath) -1);
+ StrCatS(DestPath, PathSize/sizeof(CHAR16), L"\\");
} else if (CleanFilePathStr[StrLen(CleanFilePathStr)-1] == L'\\' && Node->FileName[0] == L'\\') {
((CHAR16*)DestPath)[StrLen(DestPath)-1] = CHAR_NULL;
}
- StrnCat(DestPath, Node->FileName, PathSize/sizeof(CHAR16) - StrLen(DestPath) -1);
+ StrCatS(DestPath, PathSize/sizeof(CHAR16), Node->FileName);
} else {
- StrnCpy(DestPath, CleanFilePathStr, PathSize/sizeof(CHAR16) -1);
+ StrCpyS(DestPath, PathSize/sizeof(CHAR16), CleanFilePathStr);
if (CleanFilePathStr[StrLen(CleanFilePathStr)-1] != L'\\' && Node->FileName[0] != L'\\') {
- StrnCat(DestPath, L"\\", PathSize/sizeof(CHAR16) - StrLen(DestPath) -1);
+ StrCatS(DestPath, PathSize/sizeof(CHAR16), L"\\");
} else if (CleanFilePathStr[StrLen(CleanFilePathStr)-1] == L'\\' && Node->FileName[0] == L'\\') {
((CHAR16*)CleanFilePathStr)[StrLen(CleanFilePathStr)-1] = CHAR_NULL;
}
- StrnCat(DestPath, Node->FileName, PathSize/sizeof(CHAR16) - StrLen(DestPath) -1);
+ StrCatS(DestPath, PathSize/sizeof(CHAR16), Node->FileName);
}
}
- FreePool (CleanFilePathStr);
+
//
// Make sure the path exists
//
if (EFI_ERROR(VerifyIntermediateDirectories(DestPath))) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DIR_WNF), gShellLevel2HiiHandle);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DIR_WNF), gShellLevel2HiiHandle, L"cp", DestPath);
ShellStatus = SHELL_DEVICE_ERROR;
break;
}
@@ -500,12 +515,12 @@ ValidateAndCopyFiles(
&& !EFI_ERROR(ShellIsDirectory(DestPath))
&& StrniCmp(Node->FullName, DestPath, StrLen(DestPath)) == NULL
){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_PARENT), gShellLevel2HiiHandle);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_PARENT), gShellLevel2HiiHandle, L"cp");
ShellStatus = SHELL_INVALID_PARAMETER;
break;
}
if (StringNoCaseCompare(&Node->FullName, &DestPath) == 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_SAME), gShellLevel2HiiHandle);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_SAME), gShellLevel2HiiHandle, L"cp");
ShellStatus = SHELL_INVALID_PARAMETER;
break;
}
@@ -513,7 +528,7 @@ ValidateAndCopyFiles(
if ((StrniCmp(Node->FullName, DestPath, StrLen(Node->FullName)) == 0)
&& (DestPath[StrLen(Node->FullName)] == CHAR_NULL || DestPath[StrLen(Node->FullName)] == L'\\')
) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_SAME), gShellLevel2HiiHandle);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_SD_SAME), gShellLevel2HiiHandle, L"cp");
ShellStatus = SHELL_INVALID_PARAMETER;
break;
}
@@ -527,7 +542,7 @@ ValidateAndCopyFiles(
//
// copy single file...
//
- ShellStatus = CopySingleFile(Node->FullName, DestPath, &Response, SilentMode);
+ ShellStatus = CopySingleFile(Node->FullName, DestPath, &Response, SilentMode, L"cp");
if (ShellStatus != SHELL_SUCCESS) {
break;
}
@@ -539,6 +554,7 @@ ValidateAndCopyFiles(
SHELL_FREE_NON_NULL(DestPath);
SHELL_FREE_NON_NULL(HiiOutput);
SHELL_FREE_NON_NULL(HiiResultOk);
+ SHELL_FREE_NON_NULL(CleanFilePathStr);
if (Resp == NULL) {
SHELL_FREE_NON_NULL(Response);
}
@@ -579,7 +595,7 @@ ProcessValidateAndCopyFiles(
ShellOpenFileMetaArg((CHAR16*)DestDir, EFI_FILE_MODE_READ, &List);
if (List != NULL && List->Link.ForwardLink != List->Link.BackLink) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MARG_ERROR), gShellLevel2HiiHandle, DestDir);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_MARG_ERROR), gShellLevel2HiiHandle, L"cp", DestDir);
ShellStatus = SHELL_INVALID_PARAMETER;
ShellCloseFileMetaArg(&List);
} else if (List != NULL) {
@@ -592,7 +608,7 @@ ProcessValidateAndCopyFiles(
if ((FileInfo->Attribute & EFI_FILE_READ_ONLY) == 0) {
ShellStatus = ValidateAndCopyFiles(FileList, FullName, SilentMode, RecursiveMode, NULL);
} else {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_ERROR), gShellLevel2HiiHandle);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_CP_DEST_ERROR), gShellLevel2HiiHandle, L"cp");
ShellStatus = SHELL_ACCESS_DENIED;
}
} else {
@@ -634,6 +650,7 @@ ShellCommandRunCp (
BOOLEAN SilentMode;
BOOLEAN RecursiveMode;
CONST CHAR16 *Cwd;
+ CHAR16 *FullCwd;
ProblemParam = NULL;
ShellStatus = SHELL_SUCCESS;
@@ -655,7 +672,7 @@ ShellCommandRunCp (
Status = ShellCommandLineParse (ParamList, &Package, &ProblemParam, TRUE);
if (EFI_ERROR(Status)) {
if (Status == EFI_VOLUME_CORRUPTED && ProblemParam != NULL) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, ProblemParam);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PROBLEM), gShellLevel2HiiHandle, L"cp", ProblemParam);
FreePool(ProblemParam);
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
@@ -685,7 +702,7 @@ ShellCommandRunCp (
//
// we have insufficient parameters
//
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW), gShellLevel2HiiHandle, L"cp");
ShellStatus = SHELL_INVALID_PARAMETER;
break;
case 2:
@@ -694,15 +711,23 @@ ShellCommandRunCp (
//
Cwd = ShellGetCurrentDir(NULL);
if (Cwd == NULL){
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_NO_CWD), gShellLevel2HiiHandle, L"cp");
ShellStatus = SHELL_INVALID_PARAMETER;
} else {
Status = ShellOpenFileMetaArg((CHAR16*)ShellCommandLineGetRawValue(Package, 1), EFI_FILE_MODE_WRITE|EFI_FILE_MODE_READ, &FileList);
if (FileList == NULL || IsListEmpty(&FileList->Link) || EFI_ERROR(Status)) {
- 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, L"cp", ShellCommandLineGetRawValue(Package, 1));
ShellStatus = SHELL_NOT_FOUND;
} else {
- ShellStatus = ProcessValidateAndCopyFiles(FileList, Cwd, SilentMode, RecursiveMode);
+ FullCwd = AllocateZeroPool(StrSize(Cwd) + sizeof(CHAR16));
+ if (FullCwd == NULL) {
+ ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellLevel2HiiHandle, L"cp");
+ ShellStatus = SHELL_OUT_OF_RESOURCES;
+ } else {
+ StrCpyS (FullCwd, StrSize (Cwd) / sizeof (CHAR16) + 1, Cwd);
+ ShellStatus = ProcessValidateAndCopyFiles (FileList, FullCwd, SilentMode, RecursiveMode);
+ FreePool (FullCwd);
+ }
}
}
@@ -717,7 +742,7 @@ 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, LoopCounter));
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_FILE_NF), gShellLevel2HiiHandle, L"cp", ShellCommandLineGetRawValue(Package, LoopCounter));
ShellStatus = SHELL_NOT_FOUND;
}
}
@@ -731,7 +756,7 @@ ShellCommandRunCp (
ShellStatus = ProcessValidateAndCopyFiles(FileList, PathCleanUpDirectories((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);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_FILE), gShellLevel2HiiHandle, L"cp", ShellCommandLineGetRawValue(Package, ParamCount), ShellStatus|MAX_BIT);
ShellStatus = SHELL_ACCESS_DENIED;
}
}