//\r
\r
/**\r
- Removes the last directory or file entry in a path by changing the last\r
- L'\' to a CHAR_NULL.\r
+ Removes the last directory or file entry in a path.\r
\r
@param[in, out] Path The pointer to the path to modify.\r
\r
#include <Library/BaseLib.h>\r
\r
/**\r
- Removes the last directory or file entry in a path by changing the last\r
- L'\' to a CHAR_NULL. For a path which is like L"fs0:startup.nsh",\r
- it's converted to L"fs0:".\r
+ Removes the last directory or file entry in a path. For a path which is\r
+ like L"fs0:startup.nsh", it's converted to L"fs0:".\r
\r
@param[in,out] Path A pointer to the path to modify.\r
\r
; Walker != NULL && *Walker != CHAR_NULL\r
; Walker++\r
){\r
- if ((*Walker == L'\\' || *Walker == L':') && *(Walker + 1) != CHAR_NULL) {\r
+ if (*Walker == L'\\' && *(Walker + 1) != CHAR_NULL) {\r
+ LastSlash = Walker+1;\r
+ } else if (*Walker == L':' && *(Walker + 1) != L'\\' && *(Walker + 1) != CHAR_NULL) {\r
LastSlash = Walker+1;\r
}\r
}\r