Date: Fri, 10 Jun 2016 07:03:36 -0500 From: Pedro Giffuni <pfg@FreeBSD.org> To: Andrey Chernov <ache@freebsd.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r301777 - head/lib/libc/stdio Message-ID: <cd74f302-f089-3208-a6ca-89eb7460d41b@FreeBSD.org> In-Reply-To: <3346cab5-d713-c1ad-5e50-ea8d50ee47b9@freebsd.org> References: <201606100521.u5A5Lqa6035072@repo.freebsd.org> <3346cab5-d713-c1ad-5e50-ea8d50ee47b9@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
(Sorry I have been offline/sleep for a while) Hello; I cannot back this out because of this report: http://docs.freebsd.org/cgi/mid.cgi?20160608132224.GA15454 This change only re-states what has been working before the ABI breakage fix in r301461. The fix to regex is completely independent. Pedro. On 06/10/16 03:20, Andrey Chernov wrote: > Please back it out. __sccl() use plain chars, you can't just call wide > chars __wcollate_range_cmp() from it. Never intermix plain chars and > wide chars without conversion. The problem is somewhere else. The code > used for [a-z] ranges in the format. Moreover, even if conversion added > this code can't work with wchars by definition since uses the same loop > as in regcomp() > for (i = 0; i < 256; i ++) > > Counting completely broken regcomp, our locale quickly becomes > intermixing junk of chars and wchars without any conversion. Please > anybody stop hacking here, especially blindly adding wchars everywhere > without analyzing rest of code. > If you see 256 or UCHAR_MAX somewhere, this function can't be converted > to wchars. > > On 10.06.2016 8:21, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Fri Jun 10 05:21:52 2016 >> New Revision: 301777 >> URL: https://svnweb.freebsd.org/changeset/base/301777 >> >> Log: >> Fix regression from r301461. >> >> The fix to the __collate_range_cmp() ABI breakage missed some replacements >> in libc's vfscanf(). Replace them with __wcollate_range_cmp() which >> does what is expected. >> >> This was breaking applications like xterm and pidgin when using wide >> characters. >> >> Reported by: Vitalij Satanivskij >> Approved by: re >> >> Modified: >> head/lib/libc/stdio/vfscanf.c >> >> Modified: head/lib/libc/stdio/vfscanf.c >> ============================================================================== >> --- head/lib/libc/stdio/vfscanf.c Fri Jun 10 04:04:55 2016 (r301776) >> +++ head/lib/libc/stdio/vfscanf.c Fri Jun 10 05:21:52 2016 (r301777) >> @@ -873,7 +873,7 @@ doswitch: >> n = *fmt; >> if (n == ']' >> || (table->__collate_load_error ? n < c : >> - __collate_range_cmp (table, n, c) < 0 >> + __wcollate_range_cmp(table, n, c) < 0 >> ) >> ) { >> c = '-'; >> @@ -887,8 +887,8 @@ doswitch: >> } while (c < n); >> } else { >> for (i = 0; i < 256; i ++) >> - if ( __collate_range_cmp (table, c, i) < 0 >> - && __collate_range_cmp (table, i, n) <= 0 >> + if (__wcollate_range_cmp(table, c, i) < 0 && >> + __wcollate_range_cmp(table, i, n) <= 0 >> ) >> tab[i] = v; >> } >> >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cd74f302-f089-3208-a6ca-89eb7460d41b>