From: Eric Leblond Date: Tue, 4 Feb 2014 08:27:45 +0000 (+0100) Subject: ulogd: add carriage return as separator X-Git-Tag: ulogd-2.0.4~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5719f2713a8ce512d0361a5c0bc4d0e878117469;p=thirdparty%2Fulogd2.git ulogd: add carriage return as separator If the file is in DOS mode, the string coming from config file parsing are containing the carriage return. The result is that string are not correct and the parsing of confuguration file is failling. --- diff --git a/src/conffile.c b/src/conffile.c index b8e82a8..66769de 100644 --- a/src/conffile.c +++ b/src/conffile.c @@ -146,7 +146,7 @@ int config_parse_file(const char *section, struct config_keyset *kset) return -ERRTOOLONG; } - if (!(wordend = get_word(line, " \t\n[]", (char *) wordbuf))) + if (!(wordend = get_word(line, " \t\n\r[]", (char *) wordbuf))) continue; pr_debug("word: \"%s\"\n", wordbuf); if (!strcmp(wordbuf, section)) { @@ -178,7 +178,7 @@ int config_parse_file(const char *section, struct config_keyset *kset) return -ERRTOOLONG; } - if (!(wordend = get_word(line, " =\t\n", (char *) &wordbuf))) + if (!(wordend = get_word(line, " =\t\n\r", (char *) &wordbuf))) continue; if (wordbuf[0] == '[' ) { @@ -195,7 +195,7 @@ int config_parse_file(const char *section, struct config_keyset *kset) continue; } - wordend = get_word(wordend, " =\t\n", (char *) &wordbuf); + wordend = get_word(wordend, " =\t\n\r", (char *) &wordbuf); args = (char *)&wordbuf; if (ce->hit && !(ce->options & CONFIG_OPT_MULTI))