From: Niels Möller Date: Wed, 14 May 2014 18:47:37 +0000 (+0200) Subject: Avoid the bash construction ${#foo}, in nettle-pbkdf2 test. X-Git-Tag: nettle_3.0_release_20140607~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=56e05f0b82df552517a0c71d408c9d1819cb0a2b;p=thirdparty%2Fnettle.git Avoid the bash construction ${#foo}, in nettle-pbkdf2 test. --- diff --git a/ChangeLog b/ChangeLog index 5084b1df..63f7ec52 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-05-14 Niels Möller + + * testsuite/nettle-pbkdf2-test: Avoid the bash construction + ${#foo}. + 2014-05-09 Niels Möller * mini-gmp.c: Updated, use version from gmp-6.0.0. diff --git a/testsuite/nettle-pbkdf2-test b/testsuite/nettle-pbkdf2-test index a1e26380..e1241e16 100755 --- a/testsuite/nettle-pbkdf2-test +++ b/testsuite/nettle-pbkdf2-test @@ -9,7 +9,9 @@ test_pbkdf2 () { salt="$2" iters="$3" expected="$4" - length=`expr ${#expected} / 2` + # Relies on division rounding down; breaks if + # $expected contains more than one space. + length=`expr "$expected" : '.*' / 2` printf "%s" "$password" | $EMULATOR ../tools/nettle-pbkdf2 \ -i "$iters" -l "$length" "$salt" > test1.out