Hi Michal,<br><br>Is this what you have in mind?<br><br>diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c<br>index 8cf7660..cb4d60d 100644<br>--- a/src/gallium/auxiliary/util/u_debug.c<br>
+++ b/src/gallium/auxiliary/util/u_debug.c<br>@@ -180,6 +180,13 @@ debug_get_num_option(const char *name, long dfault)<br> return result;<br> }<br> <br>+static boolean is_alphanumeric(char c)<br>+{<br>+ return (c >= 'a' && c <= 'z') ||<br>
+ (c >= 'A' && c <= 'Z') ||<br>+ (c >= '0' && c <= '9');<br>+}<br>+<br> static boolean str_has_option(const char *str, const char *name)<br>
{<br>
const char *substr;<br>@@ -200,17 +207,17 @@ static boolean str_has_option(const char *str, const char *name)<br> unsigned name_len = strlen(name);<br> <br> /* OPTION=name,... */<br>- if (substr == str && substr[name_len] == ',') {<br>
+ if (substr == str && !is_alphanumeric(substr[name_len])) {<br> return TRUE;<br> }<br> <br> /* OPTION=...,name */<br>- if (substr+name_len == str+strlen(str) && substr[-1] == ',') {<br>
+ if (substr+name_len == str+strlen(str) && !is_alphanumeric(substr[-1])) {<br> return TRUE;<br> }<br> <br> /* OPTION=...,name,... */<br>- if (substr[-1] == ',' && substr[name_len] == ',') {<br>
+ if (!is_alphanumeric(substr[-1]) && !is_alphanumeric(substr[name_len])) {<br> return TRUE;<br> }<br> }<br><br>Marek<br><br><div class="gmail_quote">On Wed, Jan 26, 2011 at 10:59 AM, Michal Krol <span dir="ltr"><<a href="mailto:michal@vmware.com" target="_blank">michal@vmware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">On 2011-01-26 09:48, Marek Olšák wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Module: Mesa<br>
Branch: master<br>
Commit: c7c733545a19aab3e2b954153b9348ebe3147368<br>
URL: <a href="http://cgit.freedesktop.org/mesa/mesa/commit/?id=c7c733545a19aab3e2b954153b9348ebe3147368" target="_blank">http://cgit.freedesktop.org/mesa/mesa/commit/?id=c7c733545a19aab3e2b954153b9348ebe3147368</a><br>
<br>
Author: Marek Olšák<<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>><br>
Date: Mon Jan 24 23:41:51 2011 +0100<br>
<br>
util: require debug options to be separated by commas<br>
<br>
Let's assume there are two options with names such that one is a substring<br>
of another. Previously, if we only specified the longer one as a debug option,<br>
the shorter one would be considered specified as well (because of strstr).<br>
This commit fixes it by checking that each option is surrounded by commas.<br>
<br>
</blockquote>
<br>
Marek,<br>
<br>
What about just checking whether the preceding and trailing character is not alphanumeric?<br>
<br>
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.<br>
<br>
Thanks.<br>
<br>
</blockquote></div><br>