summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Rehak <martin.rehak@oracle.com>2020-11-18 09:10:01 +0100
committerAkim Demaille <akim.demaille@gmail.com>2021-01-23 09:27:30 +0100
commit1e0b0872448debb5e51c6393d11489a8d8166207 (patch)
tree81d6edf5478d08caad20b003bd2796e88777a9ed
parent4744faf2055d5b3aacfacc10ba8b4bb84693ec24 (diff)
downloadbison-1e0b0872448debb5e51c6393d11489a8d8166207.tar.gz
examples: avoid "unbound variable" errors
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.
-rwxr-xr-xexamples/test1
1 files changed, 1 insertions, 0 deletions
diff --git a/examples/test b/examples/test
index 81076701..7590e128 100755
--- a/examples/test
+++ b/examples/test
@@ -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