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