summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-04-23 17:12:13 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-04-23 17:12:13 (EDT)
commit86ae9bb68973165682b7ee23743ab6c790cefbc2 (patch)
tree3d291ab19e5d7934ae3dae2132307c1aa41f622d
parent1b5f9fea85ca6fe0ba5786367e1da11bc4df808e (diff)
ob_parse_control(): Replace param prefix/suffix removals with read
-rw-r--r--src/control.sh9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/control.sh b/src/control.sh
index 45600a6..2a7634d 100644
--- a/src/control.sh
+++ b/src/control.sh
@@ -100,11 +100,10 @@ parse_control()
return 0
fi
fi
- name="${line%%:*}"
- value="${line#*:}"
- value="${value# }"
- if [ "x${name}" = 'x' -o "x${name}" = \
- "x${line}" ]; then
+ IFS=': ' read name value <<-EOF
+ ${line}
+ EOF
+ if [ "x${name}" = 'x' ]; then
_parse_control_error "${file}" \
"${line_nr}" 'control_bad_nv'
continue