From f06059ec9481b06c0996f763ccc5db77ae7b7820 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 25 Aug 2011 21:58:03 +0200 Subject: [PATCH] =?UTF-8?q?Bugfix:=20Accept=20'\t'=20in=20the=20'set'=20co?= =?UTF-8?q?mmand,=20don=E2=80=99t=20die=20but=20ELOG=20in=20case=20of=20er?= =?UTF-8?q?rors=20(Thanks=20atsutane)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/cfgparse.y | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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';