Hello Sergey,
* Sergey Poznyakoff wrote on Tue, Aug 11, 2009 at 03:07:03PM CEST:
> --- a/lib/exclude.c
> +++ b/lib/exclude.c
> +
> +/* Return true if str has wildcard characters */
> +bool
> +fnmatch_pattern_has_wildcards (const char *str, int options)
> +{
> + char *cset = "\\?*[]";
> + if (options & FNM_NOESCAPE)
> + cset++;
> + while (*str)
> + {
> + size_t n = strcspn (str, cset);
> + if (str[n] == 0)
> + break;
> + else if (str[n] == '\\')
> + {
> + str += n + 1;
> + if (*str)
> + str++;
> + }
> + else
> + return true;
> + }
> + return false;
> +}
This would seem to still mis-characterizes patterns such as 'foo]'.
Please omit the ] from cset.
Cheers,
Ralf