Mesa (master): gallium/util: Fix parsing of options with underscore.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Wed Jun 27 10:18:30 UTC 2012


Module: Mesa
Branch: master
Commit: d1c5ea9207c5ce036fda123430c40364ab8de5af
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d1c5ea9207c5ce036fda123430c40364ab8de5af

Author: José Fonseca <jfonseca at vmware.com>
Date:   Wed Jun 27 11:15:53 2012 +0100

gallium/util: Fix parsing of options with underscore.

For example

  GALLIVM_DEBUG=no_brilinear

which was being parsed as two options, "no" and "brilinear".

---

 src/gallium/auxiliary/util/u_debug.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c
index 0a350ca..bf98f22 100644
--- a/src/gallium/auxiliary/util/u_debug.c
+++ b/src/gallium/auxiliary/util/u_debug.c
@@ -204,7 +204,7 @@ static boolean str_has_option(const char *str, const char *name)
        * we compare 'start' up to 'str-1' with 'name'. */
 
       while (1) {
-         if (!*str || !isalnum(*str)) {
+         if (!*str || !(isalnum(*str) || *str == '_')) {
             if (str-start == name_len &&
                 !memcmp(start, name, name_len)) {
                return TRUE;




More information about the mesa-commit mailing list