summaryrefslogtreecommitdiffstats
path: root/src/ob-installdocs.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 /src/ob-installdocs.sh
parent2ddb616b87a2a4684d03c9b54e95f800e73017d9 (diff)
Protect [ commands from strings beginning with "-"
Diffstat (limited to 'src/ob-installdocs.sh')
-rw-r--r--src/ob-installdocs.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ob-installdocs.sh b/src/ob-installdocs.sh
index 6b15e2c..cf67383 100644
--- a/src/ob-installdocs.sh
+++ b/src/ob-installdocs.sh
@@ -29,7 +29,7 @@ install_docs()
for src in ${srcs}; do
if [ -f "${src}" ]; then
- if [ "${dest%/*}" != "${dest}" ]; then
+ if [ x"${dest%/*}" != x"${dest}" ]; then
if ! mkdir -p "${data_doc_dir}/${dest%/*}"; then
ob_error "$(ob_get_msg 'cant_make_doc_dir')"
return 1
@@ -40,7 +40,7 @@ install_docs()
return 1
fi
elif [ -d "${src}" ]; then
- if [ "${dest%/*}" != "${dest}" ]; then
+ if [ x"${dest%/*}" != x"${dest}" ]; then
if ! mkdir -p "${data_doc_dir}/${dest%/*}"; then
ob_error "$(ob_get_msg 'cant_make_doc_dir')"
return 1
@@ -77,7 +77,7 @@ main()
doc_dir="$(ob_get_system_path 'package-docs' \
"${pkg}" "${OPK_BINARY_VERSION}")"
data_doc_dir="${pkg}.data/${doc_dir%/}"
- if [ "${pkg}" = "${doc_pkg}" ]; then
+ if [ x"${pkg}" = x"${doc_pkg}" ]; then
if [ -d "${data_doc_dir}" ]; then
ob_info "$(ob_get_msg 'docs_already_installed')" "${pkg}"
else