From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43833) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCaCE-0001a8-SH for qemu-devel@nongnu.org; Tue, 27 Mar 2012 13:28:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCaCD-0000at-52 for qemu-devel@nongnu.org; Tue, 27 Mar 2012 13:28:38 -0400 Message-ID: <4F71F8C0.9040109@weilnetz.de> Date: Tue, 27 Mar 2012 19:28:32 +0200 From: Stefan Weil MIME-Version: 1.0 References: <1332867470-29780-1-git-send-email-sw@weilnetz.de> <4F71F442.7080201@redhat.com> In-Reply-To: <4F71F442.7080201@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] Fix conversion from lower to upper case with Turkish locale List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-trivial@nongnu.org, Peter Maydell , Andreas Faerber , qemu-devel@nongnu.org, Emre Ersin Am 27.03.2012 19:09, schrieb Eric Blake: > On 03/27/2012 10:57 AM, Stefan Weil wrote: >> Some locale settings let make fail or create wrong results >> because tr '[:lower:]' '[:upper:]' which is used to convert >> from lower to upper case depends on the locale. >> >> With locale tr_TR.UTF-8, lower case 'i' is not converted to 'I'. >> This results in wrong entries in config-host.h like these ones: >> >> #define CONFIG_QEMU_PREFiX "/usr/local" >> #define CONFIG_QEMU_BiNDiR "/usr/local/bin" > >> for card in $audio_card_list; do >> - def=CONFIG_`echo $card | tr '[:lower:]' '[:upper:]'` >> + def=CONFIG_`echo $card | tr '[a-z]' '[A-Z]'` > > NACK. POSIX says that 'tr a-z' is unspecified outside of the POSIX > locale, but without setting LC_ALL=C, you aren't guaranteeing the POSIX > locale. If you want to be portable without use of [:lower:], you have > to spell it out, with abcdefghijklmnopqrstuvwxyz. Thanks for your review. I don't think that QEMU will run on systems with EBCDIC or other strange character sets where [a-z] would not work, but of course settings LC_ALL=C is better. So I have sent a new patch which adds this to every invocation of tr. Regards, Stefan Weil