bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

diff_opts initialization missing in examples/test


From: Martin Rehak
Subject: diff_opts initialization missing in examples/test
Date: Wed, 18 Nov 2020 09:10:01 +0100
User-agent: astroid/0.15.0 (https://github.com/astroidmail/astroid)

Hello,

on platforms where diff doesn't have --strip-trailing-cr option test 
is failing on 

unbound variable

because shell nounset is set to on and diff_opts variable is not 
initialized before it is evaluated at

44 echo "checking for diff --strip-trailing-cr... $diff_opts"

Following one liner resolves the issue:

--- a/examples/test     2020-09-21 07:00:47.000000000 +0200
+++ b/examples/test     2020-11-13 16:55:13.007708974 +0100
@@ -37,6 +37,7 @@
 # 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

Regards
-- 
Martin Rehak



reply via email to

[Prev in Thread] Current Thread [Next in Thread]