common/rc: add missing 'local' keywords
authorEric Biggers <ebiggers@google.com>
Sat, 7 Apr 2018 02:35:29 +0000 (19:35 -0700)
committerEryu Guan <guaneryu@gmail.com>
Thu, 12 Apr 2018 10:52:24 +0000 (18:52 +0800)
commit1ddae54555b62a33a7dd0870f07273a33fafa773
tree7e8a99b6a92ce3ab82b859f0e2995283a1a1c7b7
parent4cabd42a78d242650b1053520af308011061343e
common/rc: add missing 'local' keywords

Many helper functions in xfstests are unnecessarily declaring variables
without the 'local' keyword, which pollutes the global namespace and can
collide with variables in tests.  Fix this for everything in common/rc
that I could find.

In _math(), just eliminate $result by removing the check for nonempty
$BC, which is redundant with _require_math() which the tests do.

Signed-off-by: Eric Biggers <ebiggers@google.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/rc