bug-grep
[Top][All Lists]
Advanced

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

Re: Bug#624387: [bug #33198] Incorrect bracket expression when parsing i


From: Paolo Bonzini
Subject: Re: Bug#624387: [bug #33198] Incorrect bracket expression when parsing in ru_RU.KOI8-R (Russian locale)
Date: Fri, 03 Jun 2011 15:54:07 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10

On 06/02/2011 11:08 PM, Jim Meyering wrote:
  #if MBS_SUPPORT
-      int b2 = wctob ((unsigned char) b);
-      if (b2 == EOF || b2 == b)
+      /* Below, note how when b2 != b and we have a uni-byte locale
+         (MB_CUR_MAX == 1), we set b = b2.  I.e., in a uni-byte locale,
+         we can safely call setbit with a non-EOF value returned by wctob.  */
+      int b2 = wctob (b);
+      if (b2 == EOF || b2 == b || (MB_CUR_MAX == 1 ? (b=b2), 1 : 0))

Can you explain again the reason for testing "b2 == EOF"? It seems wrong, and without it you can just make

if (MB_CUR_MAX == 1 || b2 == b)
  setbit ((unsigned char) b, c);

Paolo



reply via email to

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