From: Michael Stapelberg Date: Thu, 25 Aug 2011 19:58:03 +0000 (+0200) Subject: Bugfix: Accept '\t' in the 'set' command, don’t die but ELOG in case of errors (Thank... X-Git-Tag: 4.0.2~21^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f06059ec9481b06c0996f763ccc5db77ae7b7820;p=i3%2Fi3 Bugfix: Accept '\t' in the 'set' command, don’t die but ELOG in case of errors (Thanks atsutane) --- diff --git a/src/cfgparse.y b/src/cfgparse.y index abbe4da0..a80e25af 100644 --- a/src/cfgparse.y +++ b/src/cfgparse.y @@ -350,13 +350,18 @@ void parse_file(const char *f) { continue; if (strcasecmp(key, "set") == 0) { - if (value[0] != '$') - die("Malformed variable assignment, name has to start with $\n"); + if (value[0] != '$') { + ELOG("Malformed variable assignment, name has to start with $\n"); + continue; + } /* get key/value for this variable */ char *v_key = value, *v_value; - if ((v_value = strstr(value, " ")) == NULL) - die("Malformed variable assignment, need a value\n"); + if ((v_value = strstr(value, " ")) == NULL && + (v_value = strstr(value, "\t")) == NULL) { + ELOG("Malformed variable assignment, need a value\n"); + continue; + } *(v_value++) = '\0';