summaryrefslogtreecommitdiff
path: root/build-aux/mktempd
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2008-05-14 18:50:53 +0200
committerJim Meyering <meyering@redhat.com>2008-05-14 18:50:53 +0200
commita297e50aaea292a9abcbf5a4de78a1d21b2fd0da (patch)
treeb7981aee8a127a99255ef548a46059725b559ccf /build-aux/mktempd
parent49161ce7902821ef24a9e30b16dc87147c24da65 (diff)
downloadgnulib-a297e50aaea292a9abcbf5a4de78a1d21b2fd0da.tar.gz
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.
Diffstat (limited to 'build-aux/mktempd')
-rwxr-xr-xbuild-aux/mktempd4
1 files changed, 3 insertions, 1 deletions
diff --git a/build-aux/mktempd b/build-aux/mktempd
index 5bee3f0c76..2bb424f69e 100755
--- a/build-aux/mktempd
+++ b/build-aux/mktempd
@@ -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