From bfc5e48be90383aea647a061b8d97518c4274551 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 13 Mar 2019 17:53:21 -0400 Subject: ob_parse_changelog(): Protect [ commands from strings beginning with "-" --- diff --git a/lib/changelog.sh b/lib/changelog.sh index af3255e..606282e 100644 --- a/lib/changelog.sh +++ b/lib/changelog.sh @@ -112,8 +112,8 @@ ob_parse_changelog() if [ -z "${source}" ] || \ [ -z "${distribution}" ] || \ [ -z "${version}" ] || \ - [ "${version% *}" != \ - "${version}" ]; then + [ x"${version% *}" != \ + x"${version}" ]; then _ob_parse_changelog_error "${file}" "${line_nr}" \ 'changelog_bad_heading' source='' @@ -146,8 +146,8 @@ ob_parse_changelog() maintainer="${line%% *}" date="${line#* }" if [ -z "${maintainer}" ] || [ -z "${date}" ] || - [ "${maintainer}" = "${date}" ] - then + [ x"${maintainer}" = \ + x"${date}" ]; then _ob_parse_changelog_error "${file}" "${line_nr}" \ 'changelog_bad_trailer' maintainer='' -- cgit v0.9.1