From c76ef0898b4cceeb4010086a6bc168f00cebd31e Mon Sep 17 00:00:00 2001 From: Mark Collins Date: Tue, 14 Jan 2025 13:57:47 +0000 Subject: [PATCH] util/u_debug: Ignore newlines in `parse_*_string` We now use `parse_debug_string` to parse debug strings from files, which may have newlines in them. This change ensures that newline characters are ignored during parsing, a similar change was made to `parse_enable_string` for consistency. Signed-off-by: Mark Collins Part-of: --- src/util/u_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/u_debug.c b/src/util/u_debug.c index 79934e963c0..7282179c122 100644 --- a/src/util/u_debug.c +++ b/src/util/u_debug.c @@ -426,7 +426,7 @@ parse_debug_string(const char *debug, const char *s = debug; unsigned n; - for (; n = strcspn(s, ", "), *s; s += MAX2(1, n)) { + for (; n = strcspn(s, ", \n"), *s; s += MAX2(1, n)) { if (!n) continue; @@ -453,7 +453,7 @@ parse_enable_string(const char *debug, const char *s = debug; unsigned n; - for (; n = strcspn(s, ", "), *s; s += MAX2(1, n)) { + for (; n = strcspn(s, ", \n"), *s; s += MAX2(1, n)) { bool enable; if (s[0] == '+') { enable = true;