diff options
author | P. J. McDermott <pjm@nac.net> | 2012-10-03 22:11:33 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2012-10-03 22:11:33 (EDT) |
commit | c912c66a935b0b1fa99e7c24ec5334dc2a363071 (patch) | |
tree | 71c20dfc20e1f3bc14c1ea479e9e45e48b55d82e | |
parent | 9373e9c4337247f76fb0906387b44a9c437fc28c (diff) |
Run control cb after continuation lines are found.
-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 |