/* Removes the last directory or file entry in a path by changing the last L'\' to a CHAR_NULL. */
BOOLEAN EFIAPI RemoveLastItemFromPath(IN OUT CHAR16 *Path)
/* Removes the last directory or file entry in a path by changing the last L'\' to a CHAR_NULL. */
BOOLEAN EFIAPI RemoveLastItemFromPath(IN OUT CHAR16 *Path)
{
  CHAR16  *Walker;
  CHAR16  *LastSlash;
  for ( Walker = Path, LastSlash = NULL
        ; Walker != NULL && *Walker != CHAR_NULL
        ; Walker++
        )
  {
    if ((*Walker == L'\\') && (*(Walker + 1) != CHAR_NULL)) {
      LastSlash = Walker + 1;
    }
  }
  if (LastSlash != NULL) {
    *LastSlash = CHAR_NULL;
    return (TRUE);
  }
  return (FALSE);
}