diff --git a/read_ini.sh b/read_ini.sh index d1b5eaa..bbdb6c2 100755 --- a/read_ini.sh +++ b/read_ini.sh @@ -168,7 +168,7 @@ function read_ini() local SWITCH_SHOPT="" pollute_bash - while read -r line + while read -r line || [ -n "$line" ] do #echo line = "$line" diff --git a/test/test1.ini b/test/test1.ini index ebb5536..ff86fe2 100644 --- a/test/test1.ini +++ b/test/test1.ini @@ -36,5 +36,5 @@ var8 = VAR ' 8 ; var10 - leading whitespace before variable name var10 = VAR 10 - - +; var11 - no newline at the end of file +var11 = VAR 11 \ No newline at end of file diff --git a/test/test1.out.correct b/test/test1.out.correct index fbd3d90..abc52d0 100644 --- a/test/test1.out.correct +++ b/test/test1.out.correct @@ -8,3 +8,4 @@ var7:VAR " 7 var8:VAR ' 8 var9:VAR 9 var10:VAR 10 +var11:VAR 11 diff --git a/test/test1.sh b/test/test1.sh index 0503f70..181bf1b 100755 --- a/test/test1.sh +++ b/test/test1.sh @@ -18,4 +18,4 @@ echo "var7:$INI__var7" echo "var8:$INI__var8" echo "var9:$INI__var9" echo "var10:$INI__var10" - +echo "var11:$INI__var11"