Skip to content

Commit

Permalink
Fix for __shini_parse_error calls no longer working
Browse files Browse the repository at this point in the history
The callback function __shini_parse_error is never called, because of a typo in commit db1b64f.
Also, fixed line numbers which can be used in that function
  • Loading branch information
pachi-belero authored Apr 11, 2019
1 parent f41fca9 commit bd303a0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions shini.sh
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,12 @@ shini_parse_section()
"__shini_parsed_section${POSTFIX}" "$SECTION" "$EXTRA1" "$EXTRA2" "$EXTRA3"
fi

continue
LINE_NUM=$((LINE_NUM+1))
continue
fi

# Skip over sections we don't care about, if a specific section was specified
[ "$SKIP_TO_SECTION" != '' ] && [ $SECTION_FOUND -ne 0 ] && continue;
[ "$SKIP_TO_SECTION" != '' ] && [ $SECTION_FOUND -ne 0 ] && LINE_NUM=$((LINE_NUM+1)) && continue;

# Check for new values
if shini_regex_match "$LINE" "^${RX_WS}*${RX_KEY}${RX_KEY}*${RX_WS}*="; then
Expand All @@ -178,14 +179,15 @@ shini_parse_section()
"__shini_parsed_comment${POSTFIX}" "$COMMENT" "$EXTRA1" "$EXTRA2" "$EXTRA3"
fi
fi


LINE_NUM=$((LINE_NUM+1))
continue
fi

# Announce parse errors
if [ "$LINE" != '' ] &&
shini_regex_match "$LINE" "^${RX_WS}*;.*$" &&
shini_regex_match "$LINE" "^${RX_WS}*$"; then
! shini_regex_match "$LINE" "^${RX_WS}*;.*$" &&
! shini_regex_match "$LINE" "^${RX_WS}*$"; then
if shini_function_exists "__shini_parse_error${POSTFIX}"; then
"__shini_parse_error${POSTFIX}" $LINE_NUM "$LINE" "$EXTRA1" "$EXTRA2" "$EXTRA3"
else
Expand Down

0 comments on commit bd303a0

Please sign in to comment.