bug-grep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug #33198] Incorrect bracket expression when parsing in ru_RU.KOI8


From: Jim Meyering
Subject: Re: [bug #33198] Incorrect bracket expression when parsing in ru_RU.KOI8-R (Russian locale)
Date: Sun, 08 May 2011 11:17:06 +0200

address@hidden wrote:
>> diff --git a/src/dfa.c b/src/dfa.c
>> index f2064ed..b41cbb6 100644
>> --- a/src/dfa.c
>> +++ b/src/dfa.c
>> @@ -573,7 +573,8 @@ setbit_case_fold (
>>    else
>>      {
>>  #if MBS_SUPPORT
>> -      if (wctob ((unsigned char)b) == b)
>> +      int b2 = wctob ((unsigned char) b);
>> +      if (b2 == EOF || b2 == b)
>>  #endif
>>          setbit (b, c);
>>      }
>
> Any chance this could please be recast as
>
>       int b2 = wctob((unsigned char) b);
>       if (b2 == EOF || b2 == b)
>       ...

Hi Arnold,

You appear to have misread the patch, since that is precisely
what resulted when I made that change.

> The reason is that gawk still supports C90-only compilers (I have users
> wit such compilers) and the declaration after executable code won't fly
> in that case.
>
> This also makes only one call to wctob() instead of two. :-)

I see only one use of wctob, there.
The patch above moves it from the if-condition
into a C89-compatible assignment on the previous line.
There is no decl-after-statement, since the new declaration
of b2 is the first line of the enclosing else-block.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]