Bugfix: Correctly split key/value when parsing variables (Thanks xeen)

next
Michael Stapelberg 2011-09-20 21:42:09 +01:00
parent 181bd6008d
commit e1949aa694
1 changed files with 4 additions and 2 deletions

View File

@ -358,12 +358,14 @@ void parse_file(const char *f) {
/* get key/value for this variable */
char *v_key = value, *v_value;
if ((v_value = strstr(value, " ")) == NULL &&
(v_value = strstr(value, "\t")) == NULL) {
if (strstr(value, " ") == NULL && strstr(value, "\t") == NULL) {
ELOG("Malformed variable assignment, need a value\n");
continue;
}
if (!(v_value = strstr(value, " ")))
v_value = strstr(value, "\t");
*(v_value++) = '\0';
struct Variable *new = scalloc(sizeof(struct Variable));