diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-24 01:25:10 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2019-04-24 01:25:10 (EDT) |
commit | 3031ace14b82d02324b366665ae779485c04d516 (patch) | |
tree | 3280ac745f91cf166cf563245f0bf05c4dac3d59 | |
parent | 7a4695c2881c1d353ff24766ad7b971d4602c00e (diff) |
parse_control(): Fix/improve missing fields handling
-rw-r--r-- | src/control.sh | 17 |
1 files changed, 12 insertions, 5 deletions
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=' ' |