Module: Mesa
Branch: main
Commit: 0c42c79edfb031509c9c0cf833d52a6f4c064356
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=0c42c79edfb031509c9c0cf833d52a6f4c064356

Author: José Roberto de Souza <jose.so...@intel.com>
Date:   Thu Jan  4 09:16:37 2024 -0800

utils/u_debug: Fix parse of "all,<something else>

If debug string is something like "all,file=..." the all case would
never be executed, this can be fixed by comparing up to strlen("all").

Signed-off-by: José Roberto de Souza <jose.so...@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26882>

---

 src/util/u_debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/u_debug.c b/src/util/u_debug.c
index 61f628e284b..a86b37a67e9 100644
--- a/src/util/u_debug.c
+++ b/src/util/u_debug.c
@@ -423,7 +423,7 @@ parse_debug_string(const char *debug,
 
    if (debug != NULL) {
       for (; control->string != NULL; control++) {
-         if (!strcmp(debug, "all")) {
+         if (!strncmp(debug, "all", strlen("all"))) {
             flag |= control->flag;
 
          } else {

Reply via email to