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