/* Patch a character at the beginning of a string. */
VOID EFIAPI PatchForStrTokenBefore(IN CHAR16 *Buffer, IN CHAR16 Patch)
/* Patch a character at the beginning of a string. */
VOID EFIAPI PatchForStrTokenBefore(IN CHAR16 *Buffer, IN CHAR16 Patch)
{
  CHAR16  *Str;
  if (Buffer == NULL) {
    return;
  }
  Str = Buffer;
  while (*(Str--) != '\0') {
    if ((*Str == 0) || (*Str == Patch)) {
      *Str = Patch;
    } else {
      break;
    }
  }
  return;
}