summaryrefslogtreecommitdiffstats
path: root/lib/changelog.sh
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 17:15:03 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 17:15:03 (EDT)
commite6b04d9ffd8bef2482ab61957c138ae92527206d (patch)
treef70b0b04037b1a537331eed3c6d4c397c84de5d3 /lib/changelog.sh
parent2ddb616b87a2a4684d03c9b54e95f800e73017d9 (diff)
Protect [ commands from strings beginning with "-"
Diffstat (limited to 'lib/changelog.sh')
-rw-r--r--lib/changelog.sh18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/changelog.sh b/lib/changelog.sh
index 56a53e7..c42c769 100644
--- a/lib/changelog.sh
+++ b/lib/changelog.sh
@@ -84,11 +84,11 @@ ob_parse_changelog()
line_nr=$(($line_nr + 1))
case "${line}" in
'')
- if [ "${expect}" = 'start_changes' ]; then
+ if [ x"${expect}" = x'start_changes' ]; then
changes="${changes}${_OB_LF}${line}"
- elif [ "${expect}" = 'next_or_eof' ]; then
+ elif [ x"${expect}" = x'next_or_eof' ]; then
:
- elif [ "${expect}" != 'changes_or_trailer' ]; then
+ elif [ x"${expect}" != x'changes_or_trailer' ]; then
_ob_parse_changelog_error "${file}" "${line_nr}" \
'changelog_found_blank_line' \
"$(_ob_get_changelog_expect_str "${expect}")"
@@ -97,8 +97,8 @@ ob_parse_changelog()
fi
;;
[!\ ]*)
- if [ "${expect}" != 'first_heading' -a \
- "${expect}" != 'next_or_eof' ]; then
+ if [ x"${expect}" != x'first_heading' -a \
+ x"${expect}" != x'next_or_eof' ]; then
_ob_parse_changelog_error "${file}" "${line_nr}" \
'changelog_found_heading' \
"$(_ob_get_changelog_expect_str "${expect}")"
@@ -134,7 +134,7 @@ ob_parse_changelog()
blank_lines=''
;;
' -- '*)
- if [ "${expect}" != 'changes_or_trailer' ]; then
+ if [ x"${expect}" != x'changes_or_trailer' ]; then
_ob_parse_changelog_error "${file}" "${line_nr}" \
'changelog_found_trailer' \
"$(_ob_get_changelog_expect_str "${expect}")"
@@ -162,8 +162,8 @@ ob_parse_changelog()
'changelog_bad_trailer'
;;
' '*)
- if [ "${expect}" != 'start_changes' -a \
- "${expect}" != 'changes_or_trailer' ]; then
+ if [ x"${expect}" != x'start_changes' -a \
+ x"${expect}" != x'changes_or_trailer' ]; then
_ob_parse_changelog_error "${file}" "${line_nr}" \
'changelog_found_change' \
"$(_ob_get_changelog_expect_str "${expect}")"
@@ -182,7 +182,7 @@ ob_parse_changelog()
$(cat "${file}")
EOF
- if [ "${expect}" != 'next_or_eof' ]; then
+ if [ x"${expect}" != x'next_or_eof' ]; then
_ob_parse_changelog_error "${file}" "${line_nr}" \
'changelog_found_eof' \
"$(_ob_get_changelog_expect_str "${expect}")"