]> git.proxmox.com Git - mirror_edk2.git/commitdiff
move a function to the correct library.
authorjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 13 Apr 2011 23:35:59 +0000 (23:35 +0000)
committerjcarsey <jcarsey@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 13 Apr 2011 23:35:59 +0000 (23:35 +0000)
added "ren" as an alias for "mv"

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11537 6f19259b-4bc3-4df7-8a09-765794883524

ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c
ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.c

index 9e7cd0e6e1464a1b9074f50a7528ad8431aef37a..b91ba27af04d9375356bb7c6f9a392ea49490113 100644 (file)
@@ -1545,3 +1545,51 @@ ChopLastSlash(
   return (FALSE);\r
 }\r
 \r
+/**\r
+  Function to clean up paths.  Removes the following items:\r
+    single periods in the path (no need for the current directory tag)\r
+    double periods in the path and removes a single parent directory.\r
+\r
+  This will be done inline and the resultant string may be be 'too big'.\r
+\r
+  @param[in] PathToReturn  The pointer to the string containing the path.\r
+\r
+  @return PathToReturn is always returned.\r
+**/\r
+CHAR16*\r
+EFIAPI\r
+CleanPath(\r
+  IN CHAR16 *PathToReturn\r
+  )\r
+{\r
+  CHAR16  *TempString;\r
+  UINTN   TempSize;\r
+  if (PathToReturn==NULL) {\r
+    return(NULL);\r
+  }\r
+  //\r
+  // Fix up the directory name\r
+  //\r
+  while ((TempString = StrStr(PathToReturn, L"\\..\\")) != NULL) {\r
+    *TempString = CHAR_NULL;\r
+    TempString  += 4;\r
+    ChopLastSlash(PathToReturn);\r
+    TempSize = StrSize(TempString);\r
+    CopyMem(PathToReturn+StrLen(PathToReturn), TempString, TempSize);\r
+  }\r
+  if ((TempString = StrStr(PathToReturn, L"\\..")) != NULL && *(TempString + 3) == CHAR_NULL) {\r
+    *TempString = CHAR_NULL;\r
+    ChopLastSlash(PathToReturn);\r
+  }\r
+  while ((TempString = StrStr(PathToReturn, L"\\.\\")) != NULL) {\r
+    *TempString = CHAR_NULL;\r
+    TempString  += 2;\r
+    TempSize = StrSize(TempString);\r
+    CopyMem(PathToReturn+StrLen(PathToReturn), TempString, TempSize);\r
+  }\r
+  if ((TempString = StrStr(PathToReturn, L"\\.")) != NULL && *(TempString + 2) == CHAR_NULL) {\r
+    *TempString = CHAR_NULL;\r
+  }\r
+  return (PathToReturn);\r
+}\r
+\r
index 11a15b5045903aaeaec013ee30968ebd4c560528..e54d5f3edec9610ed0ecc0dfc2a8864a604a059e 100644 (file)
@@ -111,6 +111,7 @@ 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
   //\r
   // These are installed in level 2 or 3...\r
   //\r
@@ -153,54 +154,6 @@ ShellLevel2CommandsLibDestructor (
   return (EFI_SUCCESS);\r
 }\r
 \r
-/**\r
-  Function to clean up paths.  Removes the following items:\r
-    single periods in the path (no need for the current directory tag)\r
-    double periods in the path and removes a single parent directory.\r
-\r
-  This will be done inline and the resultant string may be be 'too big'.\r
-\r
-  @param[in] PathToReturn  The pointer to the string containing the path.\r
-\r
-  @return PathToReturn is always returned.\r
-**/\r
-CHAR16*\r
-EFIAPI\r
-CleanPath(\r
-  IN CHAR16 *PathToReturn\r
-  )\r
-{\r
-  CHAR16  *TempString;\r
-  UINTN   TempSize;\r
-  if (PathToReturn==NULL) {\r
-    return(NULL);\r
-  }\r
-  //\r
-  // Fix up the directory name\r
-  //\r
-  while ((TempString = StrStr(PathToReturn, L"\\..\\")) != NULL) {\r
-    *TempString = CHAR_NULL;\r
-    TempString  += 4;\r
-    ChopLastSlash(PathToReturn);\r
-    TempSize = StrSize(TempString);\r
-    CopyMem(PathToReturn+StrLen(PathToReturn), TempString, TempSize);\r
-  }\r
-  if ((TempString = StrStr(PathToReturn, L"\\..")) != NULL && *(TempString + 3) == CHAR_NULL) {\r
-    *TempString = CHAR_NULL;\r
-    ChopLastSlash(PathToReturn);\r
-  }\r
-  while ((TempString = StrStr(PathToReturn, L"\\.\\")) != NULL) {\r
-    *TempString = CHAR_NULL;\r
-    TempString  += 2;\r
-    TempSize = StrSize(TempString);\r
-    CopyMem(PathToReturn+StrLen(PathToReturn), TempString, TempSize);\r
-  }\r
-  if ((TempString = StrStr(PathToReturn, L"\\.")) != NULL && *(TempString + 2) == CHAR_NULL) {\r
-    *TempString = CHAR_NULL;\r
-  }\r
-  return (PathToReturn);\r
-}\r
-\r
 /**\r
   returns a fully qualified directory (contains a map drive at the begining)\r
   path from a unknown directory path.\r