/* Fix a string to only have the environment variable name, removing starting at the first space of whatever is quoted and removing the leading and trailing %. */
CHAR16* FixVarName(IN CHAR16 *FileName)
/* Fix a string to only have the environment variable name, removing starting at the first space of whatever is quoted and removing the leading and trailing %. */
CHAR16* FixVarName(IN CHAR16 *FileName)
{
  CHAR16  *Copy;
  CHAR16  *TempLocation;
  Copy = FileName;
  if (FileName[0] == L'%') {
    Copy = FileName+1;
    if ((TempLocation = StrStr (Copy, L"%")) != NULL) {
      TempLocation[0] = CHAR_NULL;
    }
  }
  return (FixFileName (Copy));
}