mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
dri/common: Tokenize driParseDebugString() argument before matching debug flags.
Fixes debug string parsing when one of the supported flags is a substring of another. Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
parent
3d4f75506c
commit
6cf4142db8
1 changed files with 13 additions and 4 deletions
|
|
@ -50,10 +50,19 @@ driParseDebugString(const char *debug,
|
|||
|
||||
if (debug != NULL) {
|
||||
for (; control->string != NULL; control++) {
|
||||
if (!strcmp(debug, "all") ||
|
||||
strstr(debug, control->string) != NULL) {
|
||||
flag |= control->flag;
|
||||
}
|
||||
if (!strcmp(debug, "all")) {
|
||||
flag |= control->flag;
|
||||
|
||||
} else {
|
||||
const char *s = debug;
|
||||
unsigned n;
|
||||
|
||||
for (; n = strcspn(s, ", "), *s; s += MAX2(1, n)) {
|
||||
if (strlen(control->string) == n &&
|
||||
!strncmp(control->string, s, n))
|
||||
flag |= control->flag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue