]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
ShellPkg/reset: Support "-fwui" flag
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel2CommandsLib / Mv.c
index d02a6ae5f5c0560c7bf987b46f26be12bb8a9534..efaaeb2d7b3e665f6aef94c140e1fb934eb112d9 100644 (file)
@@ -26,7 +26,6 @@
   @retval FALSE           The move is within a file system.\r
 **/\r
 BOOLEAN\r
-EFIAPI\r
 IsBetweenFileSystem(\r
   IN CONST CHAR16     *FullName,\r
   IN CONST CHAR16     *Cwd,\r
@@ -79,7 +78,6 @@ IsBetweenFileSystem(
   @retval FALSE       The move is not\r
 **/\r
 BOOLEAN\r
-EFIAPI\r
 IsValidMove(\r
   IN CONST CHAR16     *SourcePath,\r
   IN CONST CHAR16     *Cwd,\r
@@ -161,7 +159,6 @@ IsValidMove(
   @retval SHELL_SUCCESS            The operation was sucessful.\r
 **/\r
 SHELL_STATUS\r
-EFIAPI\r
 GetDestinationLocation(\r
   IN CONST CHAR16               *DestParameter,\r
   IN OUT CHAR16                 **DestPathPointer,\r
@@ -286,7 +283,6 @@ GetDestinationLocation(
   @retval SHELL_SUCCESS     The source file was moved to the destination.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 MoveBetweenFileSystems(\r
   IN EFI_SHELL_FILE_INFO  *Node,\r
   IN CONST CHAR16         *DestPath,\r
@@ -334,7 +330,6 @@ MoveBetweenFileSystems(
   @retval SHELL_OUT_OF_RESOURCES    a memory allocation failed\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 CreateFullDestPath(\r
   IN CONST CHAR16 **DestPath,\r
   OUT CHAR16      **FullDestPath, \r
@@ -373,7 +368,6 @@ CreateFullDestPath(
   @retval SHELL_OUT_OF_RESOURCES  A memory allocation failed.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 MoveWithinFileSystems(\r
   IN EFI_SHELL_FILE_INFO  *Node,\r
   IN CHAR16               *DestPath,\r
@@ -454,7 +448,6 @@ MoveWithinFileSystems(
   @retval SHELL_OUT_OF_RESOURCES    a memory allocation failed\r
 **/\r
 SHELL_STATUS\r
-EFIAPI\r
 ValidateAndMoveFiles(\r
   IN EFI_SHELL_FILE_INFO        *FileList,\r
   OUT VOID                      **Resp,\r
@@ -736,11 +729,15 @@ ShellCommandRunMv (
             //\r
             CwdSize = StrSize(ShellGetCurrentDir(NULL)) + sizeof(CHAR16);\r
             Cwd = AllocateZeroPool(CwdSize);\r
-            ASSERT (Cwd != NULL);\r
-            StrCpyS(Cwd, CwdSize/sizeof(CHAR16), ShellGetCurrentDir(NULL));\r
-            StrCatS(Cwd, CwdSize/sizeof(CHAR16), L"\\");\r
-            ShellStatus = ValidateAndMoveFiles(FileList, &Response, Cwd);\r
-            FreePool(Cwd);\r
+            if (Cwd == NULL) {\r
+              ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_OUT_MEM), gShellLevel2HiiHandle, L"mv");\r
+              ShellStatus = SHELL_OUT_OF_RESOURCES;\r
+            } else {\r
+              StrCpyS (Cwd, CwdSize / sizeof (CHAR16), ShellGetCurrentDir (NULL));\r
+              StrCatS (Cwd, CwdSize / sizeof (CHAR16), L"\\");\r
+              ShellStatus = ValidateAndMoveFiles (FileList, &Response, Cwd);\r
+              FreePool (Cwd);\r
+            }\r
           }\r
         }\r
 \r