{\r
CHAR8 InputBuffer[_MAX_PATH];\r
CHAR8 *CurrentToken;\r
+ CHAR8 *Delimiter;\r
BOOLEAN ParseError;\r
BOOLEAN ReadError;\r
UINTN Occurrance;\r
//\r
// Get the first non-whitespace string\r
//\r
+ Delimiter = strchr (InputBuffer, '=');\r
+ if (Delimiter != NULL) {\r
+ *Delimiter = 0;\r
+ }\r
+\r
CurrentToken = strtok (InputBuffer, " \t\n");\r
- if (CurrentToken == NULL) {\r
+ if (CurrentToken == NULL || Delimiter == NULL) {\r
//\r
// Whitespace line found (or comment) so continue\r
//\r
//\r
// Copy the contents following the =\r
//\r
- CurrentToken = strtok (NULL, "= \t\n");\r
- if (CurrentToken == NULL) {\r
+ CurrentToken = Delimiter + 1;\r
+ if (*CurrentToken == 0) {\r
//\r
// Nothing found, parsing error\r
//\r
ParseError = TRUE;\r
} else {\r
+ //\r
+ // Strip leading white space\r
+ //\r
+ while (*CurrentToken == ' ' || *CurrentToken == '\t') {\r
+ CurrentToken++;\r
+ }\r
//\r
// Copy the current token to the output value\r
//\r
strcpy (Value, CurrentToken);\r
+ //\r
+ // Strip trailing white space\r
+ //\r
+ while (strlen(Value) > 0 && (*(Value + strlen(Value) - 1) == ' ' || *(Value + strlen(Value) - 1) == '\t')) {\r
+ *(Value + strlen(Value) - 1) = 0;\r
+ }\r
return EFI_SUCCESS;\r
}\r
} else {\r