Skip to content

Commit

Permalink
examples: avoid "unbound variable" errors
Browse files Browse the repository at this point in the history
When the shell option `nounset` is set, we may get "unbound variable"
errors.
https://lists.gnu.org/r/bug-bison/2020-11/msg00013.html

* examples/test (diff_opts): Be sure to initialize it.
  • Loading branch information
Martin Rehak authored and akimd committed Nov 20, 2020
1 parent 3360891 commit 2ca158c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions examples/test
Expand Up @@ -37,6 +37,7 @@ strip_prompt=false
# If diff supports --strip-trailing-cr, use it, to avoid EOL issues
# when testing Java programs on Windows.
echo "checking for diff --strip-trailing-cr..."
diff_opts=
if diff --strip-trailing-cr "$1" "$1"; then
diff_opts=--strip-trailing-cr
fi
Expand Down

0 comments on commit 2ca158c

Please sign in to comment.