[PATCH] lib/configure: use C locale for tr conversions

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

 



Using the [a-z] range in non-C locales might give wrong results (such as
estonian or turkish locales).  So force tr to run in C locale.

Signed-off-by: Mike Frysinger <vapier@xxxxxxxxxx>
---
 lib/configure |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/configure b/lib/configure
index b0529a7..b5608d6 100755
--- a/lib/configure
+++ b/lib/configure
@@ -40,7 +40,7 @@ if [ -z "$HOST" ] ; then
 fi
 [ -n "$RELEASE" ] && rel="${RELEASE}"
 # CAVEAT: tr on Solaris is a bit weird and the extra [] is otherwise harmless.
-host=`echo $HOST | sed -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\3/' -e 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | tr '[A-Z]' '[a-z]'`
+host=`echo $HOST | sed -e 's/^\([^-]*\)-\([^-]*\)-\([^-]*\)-\([^-]*\)$/\1-\3/' -e 's/^\([^-]*\)-\([^-]*\)$/\1--\2/' | LC_ALL=C tr '[A-Z]' '[a-z]'`
 cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
 sys=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo " $host $rel $cpu $sys"
@@ -48,8 +48,8 @@ echo " $host $rel $cpu $sys"
 c=config.h
 m=config.mk
 echo >$c '#define PCI_CONFIG_H'
-echo >>$c "#define PCI_ARCH_`echo $cpu | tr '[a-z]' '[A-Z]'`"
-echo >>$c "#define PCI_OS_`echo $sys | tr '[a-z]' '[A-Z]'`"
+echo >>$c "#define PCI_ARCH_`echo $cpu | LC_ALL=C tr '[a-z]' '[A-Z]'`"
+echo >>$c "#define PCI_OS_`echo $sys | LC_ALL=C tr '[a-z]' '[A-Z]'`"
 echo >$m 'WITH_LIBS='
 
 echo_n "Looking for access methods..."
-- 
1.6.1.1

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux