From c912c66a935b0b1fa99e7c24ec5334dc2a363071 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 03 Oct 2012 22:11:33 -0400 Subject: Run control cb after continuation lines are found. --- (limited to 'lib') 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 -- cgit v0.9.1