__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:
matze 2021-03-17 18:17:21 +01:00
parent ad736a66d0
commit 46638f0839

View file

@ -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()