]> git.ipfire.org Git - thirdparty/ulogd2.git/commitdiff
ulogd: add carriage return as separator
authorEric Leblond <eric@regit.org>
Tue, 4 Feb 2014 08:27:45 +0000 (09:27 +0100)
committerEric Leblond <eric@regit.org>
Sat, 22 Feb 2014 21:49:33 +0000 (22:49 +0100)
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.

src/conffile.c

index b8e82a84c5fc1663e424c450d24c0bc0991b3d3b..66769decc93c2d3b9663ad1b2f4c0cbb25fba546 100644 (file)
@@ -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))