X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fconf-parser.c;h=a87df382ea26cf6ac69bd5a0b2805b2bd15c66a2;hb=f10dda3b82dd493eada52bcc52b790a1cc1094e6;hp=b09e90ae8bd40c672c338b1073f09fa34d6f6819;hpb=f7900e258dfb8ab55f333d02d96f908ca0ea8899;p=elogind.git diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index b09e90ae8..a87df382e 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -705,9 +705,18 @@ int config_parse_strv( assert(data); if (isempty(rvalue)) { - /* Empty assignment resets the list */ + char **empty; + + /* Empty assignment resets the list. As a special rule + * we actually fill in a real empty array here rather + * than NULL, since some code wants to know if + * something was set at all... */ + empty = strv_new(NULL, NULL); + if (!empty) + return log_oom(); + strv_free(*sv); - *sv = NULL; + *sv = empty; return 0; } @@ -783,7 +792,7 @@ int config_parse_path_strv( return 0; } -int config_parse_usec( +int config_parse_sec( const char *filename, unsigned line, const char *section, @@ -800,7 +809,7 @@ int config_parse_usec( assert(rvalue); assert(data); - if (parse_usec(rvalue, usec) < 0) { + if (parse_sec(rvalue, usec) < 0) { log_error("[%s:%u] Failed to parse time value, ignoring: %s", filename, line, rvalue); return 0; }