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 <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32906>
This commit is contained in:
Mark Collins 2025-01-14 13:57:47 +00:00 committed by Marge Bot
parent aaf8a8d968
commit c76ef0898b

View file

@ -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;