]> git.tuebingen.mpg.de Git - gsu.git/commit
common: Fix gsu_is_a_number().
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 14 Feb 2015 20:17:53 +0000 (21:17 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Sat, 14 Feb 2015 20:17:53 +0000 (21:17 +0100)
commit5829a1d41d45ea6a8ce04292c8f4c9487a4414a4
tree49493b884d5c33d4f33a7452514d18ede7737e39
parenta149aac26f256c962a8787466dc0b8b282aff87b
common: Fix gsu_is_a_number().

We must use [ ... ] in gsu_is_a_number() because arithmetic expansion
with ((...))  undergoes parameter and variable expansion. For example

x=foo
gsu_is_a_number "$x"

will pass "foo" to gsu_is_a_number() where the expression  (("$1"))
tries to expand the (non-existing) variable foo, aborting the script
if set -u was given.

This bug was introduced a few month ago in commit 44860e92 (Use modern
style arithmetic evaluation everwhere).
common