__ini_value: change empty value check
Change the short-circuit check for an empty value to a more structual approach. This might be better for the code or not ..
This commit is contained in:
parent
ad736a66d0
commit
46638f0839
1 changed files with 38 additions and 41 deletions
|
@ -66,12 +66,8 @@ found {print; next}
|
||||||
# main loop (til the line was found)
|
# main loop (til the line was found)
|
||||||
!found {
|
!found {
|
||||||
line = trim($0)
|
line = trim($0)
|
||||||
# short curcit on empty lines
|
# process if the line is not empty (or only contains spaces)
|
||||||
if(line == "") {
|
if(line != "") {
|
||||||
push_line()
|
|
||||||
next
|
|
||||||
}
|
|
||||||
|
|
||||||
# check for a ini section
|
# check for a ini section
|
||||||
if(substr(line, 1, 1) == "[" && substr(line, length(line), 1) == "]") {
|
if(substr(line, 1, 1) == "[" && substr(line, length(line), 1) == "]") {
|
||||||
is_section = 1
|
is_section = 1
|
||||||
|
@ -120,6 +116,7 @@ found {print; next}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# works cause no next statement from above *structual programming*
|
# works cause no next statement from above *structual programming*
|
||||||
push_line()
|
push_line()
|
||||||
|
|
Loading…
Reference in a new issue