Hi Michal, Is this what you have in mind?
diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index 8cf7660..cb4d60d 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -180,6 +180,13 @@ debug_get_num_option(const char *name, long dfault) return result; } +static boolean is_alphanumeric(char c) +{ + return (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c >= '0' && c <= '9'); +} + static boolean str_has_option(const char *str, const char *name) { const char *substr; @@ -200,17 +207,17 @@ static boolean str_has_option(const char *str, const char *name) unsigned name_len = strlen(name); /* OPTION=name,... */ - if (substr == str && substr[name_len] == ',') { + if (substr == str && !is_alphanumeric(substr[name_len])) { return TRUE; } /* OPTION=...,name */ - if (substr+name_len == str+strlen(str) && substr[-1] == ',') { + if (substr+name_len == str+strlen(str) && !is_alphanumeric(substr[-1])) { return TRUE; } /* OPTION=...,name,... */ - if (substr[-1] == ',' && substr[name_len] == ',') { + if (!is_alphanumeric(substr[-1]) && !is_alphanumeric(substr[name_len])) { return TRUE; } } Marek On Wed, Jan 26, 2011 at 10:59 AM, Michal Krol <mic...@vmware.com> wrote: > On 2011-01-26 09:48, Marek Olšák wrote: > >> Module: Mesa >> Branch: master >> Commit: c7c733545a19aab3e2b954153b9348ebe3147368 >> URL: >> http://cgit.freedesktop.org/mesa/mesa/commit/?id=c7c733545a19aab3e2b954153b9348ebe3147368 >> >> Author: Marek Olšák<mar...@gmail.com> >> Date: Mon Jan 24 23:41:51 2011 +0100 >> >> util: require debug options to be separated by commas >> >> Let's assume there are two options with names such that one is a substring >> of another. Previously, if we only specified the longer one as a debug >> option, >> the shorter one would be considered specified as well (because of strstr). >> This commit fixes it by checking that each option is surrounded by commas. >> >> > Marek, > > What about just checking whether the preceding and trailing character is > not alphanumeric? > > It's nice to get it fixed, but changing the way config options are > specified might break development setups on a few people's machines. > > Thanks. > >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev