From 3031ace14b82d02324b366665ae779485c04d516 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 24 Apr 2019 01:25:10 -0400 Subject: parse_control(): Fix/improve missing fields handling --- diff --git a/src/control.sh b/src/control.sh index bb0c0e6..30e594e 100644 --- a/src/control.sh +++ b/src/control.sh @@ -79,16 +79,23 @@ parse_control() if ! "${paragraph_cb}"; then return 0 fi - if [ -n "${para_req_fields}" ]; then + case "${para_req_fields}" in *[!\ ]*) + # Missing required control + # fields. + sep="$(get_msg \ + 'list_item_separator')" para_req_fields="$(printf \ - "%s$(get_msg \ - 'list_item_separator')"\ - ${para_req_fields})" + "%s${sep}" \ + ${para_req_fields}; \ + printf 'x')" + para_req_fields="$(: \ + )${para_req_fields%$(: \ + )${sep}x}" _parse_control_error \ "${file}" "${line_nr}" \ 'control_missing_fields'\ "${para_req_fields}" - fi + esac fi para_req_fields="${req_fields}" got_fields=' ' -- cgit v0.9.1