Skip to content

Commit

Permalink
Merge branch 'fix_issue4'
Browse files Browse the repository at this point in the history
* fix_issue4:
  fix, last line without newline was ignored if (issue #4)
  add test case "no newline at the end of file" (issue #4)
  • Loading branch information
rudimeier committed Mar 5, 2013
2 parents 9eded6d + 860385e commit daf1fd3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion read_ini.sh
Expand Up @@ -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"

Expand Down
4 changes: 2 additions & 2 deletions test/test1.ini
Expand Up @@ -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
1 change: 1 addition & 0 deletions test/test1.out.correct
Expand Up @@ -8,3 +8,4 @@ var7:VAR " 7
var8:VAR ' 8
var9:VAR 9
var10:VAR 10
var11:VAR 11
2 changes: 1 addition & 1 deletion test/test1.sh
Expand Up @@ -18,4 +18,4 @@ echo "var7:$INI__var7"
echo "var8:$INI__var8"
echo "var9:$INI__var9"
echo "var10:$INI__var10"

echo "var11:$INI__var11"

0 comments on commit daf1fd3

Please sign in to comment.