Bugfix: Correctly split key/value when parsing variables (Thanks xeen)
This commit is contained in:
parent
181bd6008d
commit
e1949aa694
|
@ -358,12 +358,14 @@ void parse_file(const char *f) {
|
||||||
|
|
||||||
/* get key/value for this variable */
|
/* get key/value for this variable */
|
||||||
char *v_key = value, *v_value;
|
char *v_key = value, *v_value;
|
||||||
if ((v_value = strstr(value, " ")) == NULL &&
|
if (strstr(value, " ") == NULL && strstr(value, "\t") == NULL) {
|
||||||
(v_value = strstr(value, "\t")) == NULL) {
|
|
||||||
ELOG("Malformed variable assignment, need a value\n");
|
ELOG("Malformed variable assignment, need a value\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(v_value = strstr(value, " ")))
|
||||||
|
v_value = strstr(value, "\t");
|
||||||
|
|
||||||
*(v_value++) = '\0';
|
*(v_value++) = '\0';
|
||||||
|
|
||||||
struct Variable *new = scalloc(sizeof(struct Variable));
|
struct Variable *new = scalloc(sizeof(struct Variable));
|
||||||
|
|
Loading…
Reference in New Issue