Convert unquote_*_word users to expect isempty(p) after the last entry

This is so that, when called in a loop, unquote_first_word can
distinguish between reaching the end of a string because it has consumed
all the input before the end, and consuming all the input.

This is important because we later add a flag that allows

    char *in = "";
    char *out;
    unquote_first_word(&in, &out, flags);

To put "" in out, and set in = NULL, so the trailing empty string of the
input can be consumed, and mark that the input has been consumed.
This commit is contained in:
Richard Maw
2015-08-07 15:50:42 +00:00
parent 9db81db06b
commit 4b1c175351
3 changed files with 42 additions and 42 deletions
+1 -1
View File
@@ -1389,7 +1389,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
log_error("[%s:%u] Missing action and name columns.", fname, line);
return -EINVAL;
}
if (*p != 0) {
if (!isempty(p)) {
log_error("[%s:%u] Trailing garbage.", fname, line);
return -EINVAL;
}