summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-01-05 09:42:12 (EST)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-01-05 09:43:52 (EST)
commitddf9028ac7a32f5ac54099e341b059b62da46915 (patch)
treeac0918de3b9814121d92617c7c09e698d53fd86c
parent00fa1775a84ffc6327a493e47c3c2301052e3a27 (diff)
ob_parse_control(): Replace param prefix/suffix removals with read
-rw-r--r--lib/control.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/control.sh b/lib/control.sh
index bbca4d8..bf3e8fb 100644
--- a/lib/control.sh
+++ b/lib/control.sh
@@ -125,11 +125,10 @@ ob_parse_control()
return 0
fi
fi
- name="${line%%:*}"
- value="${line#*:}"
- value="${value# }"
- if [ -z "${name}" \
- -o "${name}" = "${line}" ]; then
+ IFS=': ' read name value <<-EOF
+ ${line}
+ EOF
+ if [ -z "${name}" ]; then
# Badly formatted control field.
_ob_parse_control_error "${file}" "${line_nr}" \
'control_bad_nv'