changeset 13191:45966e29b6d3

init.sh: run tr in the "C" locale to avoid multibyte interpretation * tests/init.sh (rand_bytes_): Run tr in the "C" locale so it does not try to interpret its random input bytes. Jarno Rajahalme reported that ./test-xalloc-die.sh would fail with "tr: Illegal byte sequence" on Darwin 10.3.0 with LC_CTYPE=UTF-8. (mktempd_): Likewise, just in case.
author Jim Meyering <meyering@redhat.com>
date Fri, 09 Apr 2010 20:53:49 +0200
parents 388d246a0346
children ba35e9647b3b
files ChangeLog tests/init.sh
diffstat 2 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Apr 09 19:14:37 2010 +0200
+++ b/ChangeLog	Fri Apr 09 20:53:49 2010 +0200
@@ -1,5 +1,12 @@
 2010-04-09  Jim Meyering  <meyering@redhat.com>
 
+	init.sh: run tr in the "C" locale to avoid multibyte interpretation
+	* tests/init.sh (rand_bytes_): Run tr in the "C" locale so it does
+	not try to interpret its random input bytes.  Jarno Rajahalme reported
+	that ./test-xalloc-die.sh would fail with "tr: Illegal byte sequence".
+	on Darwin 10.3.0 with LC_CTYPE=UTF-8.
+	(mktempd_): Likewise, just in case.
+
 	ftruncate: add two years to projected module removal date: 2012
 	* m4/ftruncate.m4: Adjust comments.
 
--- a/tests/init.sh	Fri Apr 09 19:14:37 2010 +0200
+++ b/tests/init.sh	Fri Apr 09 20:53:49 2010 +0200
@@ -259,7 +259,7 @@
   if test -r "$dev_rand_"; then
     # Note: 256-length($chars_) == 194; 3 copies of $chars_ is 186 + 8 = 194.
     dd ibs=$n_ count=1 if=$dev_rand_ 2>/dev/null \
-      | tr -c $chars_ 01234567$chars_$chars_$chars_
+      | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
     return
   fi
 
@@ -276,7 +276,7 @@
 
   echo "$data_" \
     | dd bs=1 skip=50 count=$n_ 2>/dev/null \
-    | tr -c $chars_ 01234567$chars_$chars_$chars_
+    | LC_ALL=C tr -c $chars_ 01234567$chars_$chars_$chars_
 }
 
 mktempd_()