X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Fmktempd;h=2bb424f69efd583369ad674ce89b3944f8c19953;hb=47862a3576e5699edb2662fe4b6e0410175efd62;hp=7ac914b31c992fa81532d06150cc509d26cca05e;hpb=644fb0d44a544046abd7f916efa0cfb315d2148f;p=gnulib.git diff --git a/build-aux/mktempd b/build-aux/mktempd index 7ac914b31..2bb424f69 100755 --- a/build-aux/mktempd +++ b/build-aux/mktempd @@ -44,7 +44,7 @@ rand_bytes() dev_rand=/dev/urandom if test -r "$dev_rand"; then # Note: 256-length($chars) == 194; 3 copies of $chars is 186 + 8 = 194. - head -c$n "$dev_rand" | tr -c $chars 01234567$chars$chars$chars + dd ibs=$n count=1 if="$dev_rand" | tr -c $chars 01234567$chars$chars$chars return fi @@ -114,7 +114,9 @@ mktempd() base_template=`echo "$template"|sed 's/XX*$//'` # Calculate how many X's we've just removed. - nx=`expr length "$template" - length "$base_template"` + template_length=`echo "$template" | wc -c` + nx=`echo "$base_template" | wc -c` + nx=`expr $template_length - $nx` err= i=1