Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Sep 2011 22:48:42 +0400
From:      Andrey Chernov <ache@FreeBSD.ORG>
To:        Gabor Kovesdan <gabor@FreeBSD.ORG>
Cc:        src-committers@FreeBSD.ORG, svn-src-user@FreeBSD.ORG
Subject:   Re: svn commit: r225347 - user/gabor/tre-integration/contrib/tre/lib
Message-ID:  <20110902184842.GA28351@vniz.net>
In-Reply-To: <201109021818.p82IIO73010722@svn.freebsd.org>
References:  <201109021818.p82IIO73010722@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110902184842.GA28351>