]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
ShellPkg: Remove redundant quotes in file path string for Shell command parameters.
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel2CommandsLib / Mv.c
index f9b83e6fa4565db8e3fc54dc52942c2bb4315d54..fcf5f657b8df9a7cdd8248a56ecf93735e44820c 100644 (file)
@@ -270,6 +270,7 @@ ValidateAndMoveFiles(
   UINTN                     Length;\r
   VOID                      *Response;\r
   SHELL_FILE_HANDLE         DestHandle;\r
+  CHAR16                    *CleanFilePathStr;\r
 \r
   ASSERT(FileList != NULL);\r
   ASSERT(DestDir  != NULL);\r
@@ -278,10 +279,20 @@ ValidateAndMoveFiles(
   Cwd      = ShellGetCurrentDir(NULL);\r
   Response = *Resp;\r
 \r
+  Status = ShellLevel2StripQuotes (DestDir, &CleanFilePathStr);\r
+  if (EFI_ERROR (Status)) {\r
+    if (Status == EFI_OUT_OF_RESOURCES) {\r
+      return SHELL_OUT_OF_RESOURCES;\r
+    } else {\r
+      return SHELL_INVALID_PARAMETER;\r
+    }\r
+  }  \r
+\r
   //\r
   // Get and validate the destination location\r
   //\r
-  ShellStatus = GetDestinationLocation(DestDir, &DestPath, Cwd);\r
+  ShellStatus = GetDestinationLocation(CleanFilePathStr, &DestPath, Cwd);\r
+  FreePool (CleanFilePathStr);\r
   if (ShellStatus != SHELL_SUCCESS) {\r
     return (ShellStatus);\r
   }\r