diff options
author | Martin Rehak <martin.rehak@oracle.com> | 2020-11-18 09:10:01 +0100 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2021-01-23 09:27:30 +0100 |
commit | 1e0b0872448debb5e51c6393d11489a8d8166207 (patch) | |
tree | 81d6edf5478d08caad20b003bd2796e88777a9ed | |
parent | 4744faf2055d5b3aacfacc10ba8b4bb84693ec24 (diff) | |
download | bison-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-x | examples/test | 1 |
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 |