From: Lennart Poettering Date: Sun, 14 Feb 2010 00:07:36 +0000 (+0100) Subject: util: fix FOREACH_WORD macro definitions X-Git-Tag: v1~695 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=f62c0e4f30a96bcb0cfeae607d729a6658bfae83;hp=c85dc17be718014260e10e41d15ba8f7329fed26 util: fix FOREACH_WORD macro definitions --- diff --git a/load-fragment.c b/load-fragment.c index 9bc9b2b6a..e2c04e26b 100644 --- a/load-fragment.c +++ b/load-fragment.c @@ -56,7 +56,7 @@ static int config_parse_deps( assert(lvalue); assert(rvalue); - FOREACH_WORD(w, &l, rvalue, state) { + FOREACH_WORD(w, l, rvalue, state) { char *t; int r; @@ -92,7 +92,7 @@ static int config_parse_names( assert(rvalue); assert(data); - FOREACH_WORD(w, &l, rvalue, state) { + FOREACH_WORD(w, l, rvalue, state) { char *t; int r; Unit *other; @@ -746,7 +746,7 @@ static int config_parse_cpu_affinity( assert(rvalue); assert(data); - FOREACH_WORD(w, &l, rvalue, state) { + FOREACH_WORD(w, l, rvalue, state) { char *t; int r; unsigned cpu; @@ -821,7 +821,7 @@ static int config_parse_secure_bits( assert(rvalue); assert(data); - FOREACH_WORD(w, &l, rvalue, state) { + FOREACH_WORD(w, l, rvalue, state) { if (first_word(w, "keep-caps")) c->secure_bits |= SECURE_KEEP_CAPS; else if (first_word(w, "keep-caps-locked")) @@ -862,7 +862,7 @@ static int config_parse_bounding_set( assert(rvalue); assert(data); - FOREACH_WORD(w, &l, rvalue, state) { + FOREACH_WORD(w, l, rvalue, state) { char *t; int r; cap_value_t cap; diff --git a/util.h b/util.h index e005a2a07..49abce1db 100644 --- a/util.h +++ b/util.h @@ -99,13 +99,13 @@ char *split(const char *c, size_t *l, const char *separator, char **state); char *split_quoted(const char *c, size_t *l, char **state); #define FOREACH_WORD(word, length, s, state) \ - for ((state) = NULL, (word) = split((s), &(l), WHITESPACE, &(state)); (word); (word) = split((s), &(l), WHITESPACE, &(state))) + for ((state) = NULL, (word) = split((s), &(length), WHITESPACE, &(state)); (word); (word) = split((s), &(length), WHITESPACE, &(state))) #define FOREACH_WORD_SEPARATOR(word, length, s, separator, state) \ - for ((state) = NULL, (word) = split((s), &(l), (separator), &(state)); (word); (word) = split((s), &(l), (separator), &(state))) + for ((state) = NULL, (word) = split((s), &(length), (separator), &(state)); (word); (word) = split((s), &(length), (separator), &(state))) #define FOREACH_WORD_QUOTED(word, length, s, state) \ - for ((state) = NULL, (word) = split_quoted((s), &(l), &(state)); (word); (word) = split_quoted((s), &(l), &(state))) + for ((state) = NULL, (word) = split_quoted((s), &(length), &(state)); (word); (word) = split_quoted((s), &(length), &(state))) char **split_path_and_make_absolute(const char *p);