]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c
ShellPkg/UefiShellLevel2CommandsLib: Remove unnecessary EFIAPI
[mirror_edk2.git] / ShellPkg / Library / UefiShellLevel2CommandsLib / UefiShellLevel2CommandsLib.c
index fe8765f21448c577fc6da84ae7a5f8e63b5af7ae..1491ee9d0672190ae6784655ba1d48ef0c3f3638 100644 (file)
@@ -21,8 +21,8 @@
 \r
   * functions are non-interactive only\r
 \r
-\r
-  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2014 Hewlett-Packard Development Company, L.P.\r
+  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -107,7 +107,9 @@ ShellLevel2CommandsLibConstructor (
   ShellCommandRegisterAlias(L"mkdir", L"md");\r
   ShellCommandRegisterAlias(L"cd ..", L"cd..");\r
   ShellCommandRegisterAlias(L"cd \\", L"cd\\");\r
-  ShellCommandRegisterAlias(L"ren", L"mv");\r
+  ShellCommandRegisterAlias(L"mv", L"ren");\r
+  ShellCommandRegisterAlias(L"mv", L"move");\r
+  ShellCommandRegisterAlias(L"map", L"mount");\r
   //\r
   // These are installed in level 2 or 3...\r
   //\r
@@ -167,7 +169,6 @@ ShellLevel2CommandsLibDestructor (
   @retval other           An allocated pointer to a fuly qualified path.\r
 **/\r
 CHAR16*\r
-EFIAPI\r
 GetFullyQualifiedPath(\r
   IN CONST CHAR16* Path\r
   )\r
@@ -186,6 +187,7 @@ GetFullyQualifiedPath(
   if (StrStr(Path, L":") == NULL) {\r
     CurDir = gEfiShellProtocol->GetCurDir(NULL);\r
     StrnCatGrow(&PathToReturn, &Size, CurDir, 0);\r
+    StrnCatGrow(&PathToReturn, &Size, L"\\", 0);\r
     if (*Path == L'\\') {\r
       Path++;\r
     }\r
@@ -213,7 +215,6 @@ GetFullyQualifiedPath(
   @retval EFI_SUCCESS   The operation was successful.\r
 **/\r
 EFI_STATUS\r
-EFIAPI\r
 VerifyIntermediateDirectories (\r
   IN CONST CHAR16 *Path\r
   )\r
@@ -267,7 +268,6 @@ VerifyIntermediateDirectories (
   @return Char as an upper case character.\r
 **/\r
 CHAR16\r
-EFIAPI\r
 InternalCharToUpper (\r
   IN CONST CHAR16                    Char\r
   );\r
@@ -283,7 +283,6 @@ InternalCharToUpper (
   @return The location in Source where there is a difference.\r
 **/\r
 CONST CHAR16*\r
-EFIAPI\r
 StrniCmp(\r
   IN CONST CHAR16 *Source,\r
   IN CONST CHAR16 *Target,\r
@@ -307,3 +306,41 @@ StrniCmp(
   return (NULL);\r
 }\r
 \r
+\r
+/**\r
+  Cleans off all the quotes in the string.\r
+\r
+  @param[in]     OriginalString   pointer to the string to be cleaned.\r
+  @param[out]   CleanString      The new string with all quotes removed. \r
+                                                  Memory allocated in the function and free \r
+                                                  by caller.\r
+\r
+  @retval EFI_SUCCESS   The operation was successful.\r
+**/\r
+EFI_STATUS\r
+ShellLevel2StripQuotes (\r
+  IN  CONST CHAR16     *OriginalString,\r
+  OUT CHAR16           **CleanString\r
+  )\r
+{\r
+  CHAR16            *Walker;\r
+  \r
+  if (OriginalString == NULL || CleanString == NULL) {\r
+    return EFI_INVALID_PARAMETER;\r
+  }\r
+\r
+  *CleanString = AllocateCopyPool (StrSize (OriginalString), OriginalString);\r
+  if (*CleanString == NULL) {\r
+    return EFI_OUT_OF_RESOURCES;\r
+  }\r
+\r
+  for (Walker = *CleanString; Walker != NULL && *Walker != CHAR_NULL ; Walker++) {\r
+    if (*Walker == L'\"') {\r
+      CopyMem(Walker, Walker+1, StrSize(Walker) - sizeof(Walker[0]));\r
+    }\r
+  }\r
+\r
+  return EFI_SUCCESS;\r
+}\r
+\r
+\r