/* Parse for the next instance of one string within another string. Can optionally make sure that the string was not escaped (^ character) per the shell specification. */
CHAR16* FindNextInstance(IN CONST CHAR16 *SourceString, IN CONST CHAR16 *FindString, IN CONST BOOLEAN CheckForEscapeCharacter)
/* Parse for the next instance of one string within another string. Can optionally make sure that the string was not escaped (^ character) per the shell specification. */
CHAR16* FindNextInstance(IN CONST CHAR16 *SourceString, IN CONST CHAR16 *FindString, IN CONST BOOLEAN CheckForEscapeCharacter)
{
  CHAR16  *Temp;
  if (SourceString == NULL) {
    return (NULL);
  }
  Temp = StrStr (SourceString, FindString);
  if ((Temp == NULL) || !CheckForEscapeCharacter) {
    return (Temp);
  }
  if ((Temp > (SourceString)) && (*(Temp-1) == L'^')) {
    return FindNextInstance (Temp+1, FindString, CheckForEscapeCharacter);
  }
  return (Temp);
}