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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user