svn commit: r225347 - user/gabor/tre-integration/contrib/tre/lib

Andrey Chernov ache at FreeBSD.ORG
Fri Sep 2 18:48:44 UTC 2011


On Fri, Sep 02, 2011 at 06:18:24PM +0000, Gabor Kovesdan wrote:
>          {								\
>            char c = islower(fg->pattern[i]) ? toupper(fg->pattern[i])	\
>              : tolower(fg->pattern[i]);					\
> -          fg->qsBc[(unsigned)c] = fg->len - i;				\
> +          fg->qsBc[(unsigned char)c] = fg->len - i;			\


It looks like there should be 

char c = islower((unsigned char)fg->pattern[i]) ? \
toupper((unsigned char)fg->pattern[i]) : \
tolower((unsigned char)fg->pattern[i]); \

I don't see whole code, it depends on what type fg->pattern[i] have.

Due to their bad design ctype macros can't be called directly on signed 
(i.e. default) char type, unless its value is known to be 7bit.

BTW, I don't understand the intention of that expression. 
You turn lower to upper and upper to lower. Ignore case mode converts all 
to single case instead.

-- 
http://ache.vniz.net/


More information about the svn-src-user mailing list