From 5589b9898b0bd9bbdfdf3c78c532e9bb104d5c41 Mon Sep 17 00:00:00 2001 From: mrb0nk500 Date: Mon, 1 Aug 2022 12:29:22 -0300 Subject: keyword: Remove trailing whitespace from the right hand side in `parse_key_value_file()` --- keyword.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyword.c b/keyword.c index 2afe455..d810f3c 100644 --- a/keyword.c +++ b/keyword.c @@ -115,6 +115,8 @@ int parse_key_value_file(void *ret, void *ctx, const keyword **keywords, char *b } else { /* Get the rest of the line. */ rhs = strtok_r(tmp, "\n", &buf); + /* Remove any whitespace ahead of us. */ + rhs = strtok_r(rhs, " \t\v\r\n", &tmp); } /* Did we fail to parse the keyword? */ -- cgit v1.2.3-13-gbd6f