From owner-svn-src-head@freebsd.org Fri Jun 10 08:20:17 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 78AB7AEE9EF for ; Fri, 10 Jun 2016 08:20:17 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: from mail-lf0-f47.google.com (mail-lf0-f47.google.com [209.85.215.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0DE8317A0 for ; Fri, 10 Jun 2016 08:20:16 +0000 (UTC) (envelope-from mailing-machine@vniz.net) Received: by mail-lf0-f47.google.com with SMTP id f6so20404757lfg.0 for ; Fri, 10 Jun 2016 01:20:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=eGy3APTA61wqi0sAudWw3hCGHjJFgeNDlJzuy8SydCo=; b=Ur76Z7D5rPYYh93jx7wN8BX8U17sZMaERiUbp5wQi7EJVQDlMYXXGA6y1dnZBpNRyB h1zN8P8QV2/DIDUveIVY+H5ubhm/e+b7nuHTwcpD5LwGDjmBCTinhHmxl7lX0vNq9zsa Urg7JpbVNJvNp9+J5iqKcTyhcCviy76tH9PRss0MMX2a5ZIS3aYG8cnUyjgla2X5YJYj A0EVGeZ15n4q7Fl/JtdHQUGFOqd8mZU9GmVbxoX/oUDdn2WiPUVPH4pdQOf3y6Fm6t64 4lGjA8cV8vf2jjBbFbqh5Y2XlPTBvjK6CsErFhJqCZ/hQw7dYizFYjMLemuL5s4zVYsN G7fg== X-Gm-Message-State: ALyK8tKHOSW+FEj75bZ/3DTFZA70BypwFK7i5m7jSX8D2C16lCKOI6OtYXLWC3ptGze5Cw== X-Received: by 10.25.81.148 with SMTP id f142mr205849lfb.206.1465546809120; Fri, 10 Jun 2016 01:20:09 -0700 (PDT) Received: from [192.168.1.2] ([89.169.173.68]) by smtp.gmail.com with ESMTPSA id kz1sm1083595lbc.4.2016.06.10.01.20.08 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Jun 2016 01:20:08 -0700 (PDT) Subject: Re: svn commit: r301777 - head/lib/libc/stdio To: "Pedro F. Giffuni" , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201606100521.u5A5Lqa6035072@repo.freebsd.org> From: Andrey Chernov Message-ID: <3346cab5-d713-c1ad-5e50-ea8d50ee47b9@freebsd.org> Date: Fri, 10 Jun 2016 11:20:07 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 In-Reply-To: <201606100521.u5A5Lqa6035072@repo.freebsd.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jun 2016 08:20:17 -0000 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; > } >