diff options
-rw-r--r-- | lib/control.sh | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/lib/control.sh b/lib/control.sh index 5dcdc29..713d5c1 100644 --- a/lib/control.sh +++ b/lib/control.sh @@ -54,6 +54,15 @@ ob_parse_control() 'control_empty_line' elif [ "${_obpco_line# }" = "${_obpco_line}" ]; then # "Name: Value" line. + if [ -n "${_obpco_name}" ]; then + OB_CONTROL_NAME="${_obpco_name}" + OB_CONTROL_VALUE="${_obpco_value}" + "${_obpco_field_cb}" + if [ ${?} -ne 0 ]; then + _ob_return 0 + return ${?} + fi + fi _obpco_name="${_obpco_line%%:*}" _obpco_value="${_obpco_line#*: }" if [ -z "${_obpco_name}" -o "${_obpco_name}" = "${_obpco_line}" \ @@ -81,13 +90,6 @@ ob_parse_control() else _obpco_got_fields="${_obpco_got_fields}${_obpco_name} " fi - OB_CONTROL_NAME="${_obpco_name}" - OB_CONTROL_VALUE="${_obpco_value}" - "${_obpco_field_cb}" - if [ ${?} -ne 0 ]; then - _ob_return 0 - return ${?} - fi else # Continuation line. if [ -z "${_obpco_name}" ]; then @@ -101,6 +103,16 @@ ${_obpco_line# }" fi done <"${_obpco_file}" + if [ -n "${_obpco_name}" ]; then + OB_CONTROL_NAME="${_obpco_name}" + OB_CONTROL_VALUE="${_obpco_value}" + "${_obpco_field_cb}" + if [ ${?} -ne 0 ]; then + _ob_return 0 + return ${?} + fi + fi + _obpco_req_fields="${_obpco_req_fields## }" _obpco_req_fields="${_obpco_req_fields%% }" if [ -n "${_obpco_req_fields}" ]; then |