Mercurial > hg > octave-nkf > gnulib-hg
changeset 10072:318ffe3ae81d
use "echo STR|wc -c" rather than unportable "expr length STR"
* build-aux/mktempd (mktempd): Vendor-supplied expr from at least
OpenBSD 4.3 and Solaris 10 do not honor expr's "length" function.
author | Lasse Collin <lasse.collin@tukaani.org> |
---|---|
date | Wed, 14 May 2008 18:50:53 +0200 |
parents | 0d2036153b5f |
children | 0f65e1606f27 |
files | ChangeLog build-aux/mktempd |
diffstat | 2 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-14 Lasse Collin <lasse.collin@tukaani.org> + + use "echo STR|wc -c" rather than unportable "expr length STR" + * build-aux/mktempd (mktempd): Vendor-supplied expr from at least + OpenBSD 4.3 and Solaris 10 do not honor expr's "length" function. + 2008-05-14 Jim Meyering <meyering@redhat.com> use dd ifs=$n count=1 ... rather than less-portable head -c$n
--- a/build-aux/mktempd +++ b/build-aux/mktempd @@ -114,7 +114,9 @@ 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