mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 04:58:05 +02:00
util/u_debug: fix parsing of "all" again
The current implementation is incorrect if the string starts with "all" like "RADV_DEBUG=allbos". Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10741 Fixes:0c42c79edf("utils/u_debug: Fix parse of "all,<something else>") Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28051> (cherry picked from commit433a3c262a)
This commit is contained in:
parent
c46abe651b
commit
e9551eaf33
2 changed files with 10 additions and 11 deletions
|
|
@ -124,7 +124,7 @@
|
|||
"description": "util/u_debug: fix parsing of \"all\" again",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "0c42c79edfb031509c9c0cf833d52a6f4c064356",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -423,18 +423,17 @@ parse_debug_string(const char *debug,
|
|||
|
||||
if (debug != NULL) {
|
||||
for (; control->string != NULL; control++) {
|
||||
if (!strncmp(debug, "all", strlen("all"))) {
|
||||
flag |= control->flag;
|
||||
const char *s = debug;
|
||||
unsigned n;
|
||||
|
||||
} else {
|
||||
const char *s = debug;
|
||||
unsigned n;
|
||||
for (; n = strcspn(s, ", "), *s; s += MAX2(1, n)) {
|
||||
if (!n)
|
||||
continue;
|
||||
|
||||
for (; n = strcspn(s, ", "), *s; s += MAX2(1, n)) {
|
||||
if (strlen(control->string) == n &&
|
||||
!strncmp(control->string, s, n))
|
||||
flag |= control->flag;
|
||||
}
|
||||
if (!strncmp("all", s, n) ||
|
||||
(strlen(control->string) == n &&
|
||||
!strncmp(control->string, s, n)))
|
||||
flag |= control->flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue