summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2017-04-20 21:50:58 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2017-04-20 22:56:14 -0400
commitd958a33c1f0e11b770481a9188cbf75cc3bfd0a5 (patch)
treeb5ae47096365863eb26a77a89af0e36b48b5ca03 /src/lib
parent2d1ae58285ade402260bf5d5a4dbf42aba027fc5 (diff)
Quote unquoted strings that should probably be quoted.
These were found with the help of shellcheck. Nothing more complicated than wrapping a variable in double quotes has been done.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/conf.sh.in14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/conf.sh.in b/src/lib/conf.sh.in
index 0b2275a..63d5cf9 100644
--- a/src/lib/conf.sh.in
+++ b/src/lib/conf.sh.in
@@ -1,7 +1,7 @@
#!/hint/bash
# This may be included with or without `set -euE`
-# Copyright (C) 2012-2015 Luke Shumaker <lukeshu@sbcglobal.net>
+# Copyright (C) 2012-2015, 2017 Luke Shumaker <lukeshu@sbcglobal.net>
#
# License: GNU GPLv2+
#
@@ -19,7 +19,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
LIBREUSER="${SUDO_USER:-$USER}"
-if [[ $LIBREUSER == $USER ]]; then
+if [[ $LIBREUSER == "$USER" ]]; then
LIBREHOME=$HOME
else
eval "LIBREHOME=~$LIBREUSER"
@@ -112,19 +112,19 @@ load_files() {
local file
# Save the existing versions at _VARNAME
- for var in $(list_envvars $slug); do
+ for var in $(list_envvars "$slug"); do
[[ -n ${!var:-} ]] && eval "_$var=\${$var}"
done
# Load the files
- for file in $(list_files $slug); do
+ for file in $(list_files "$slug"); do
if [[ -r $file ]]; then
. "$file" || return 1
fi
done
# Restore the _SAVED versions
- for var in $(list_envvars $slug); do
+ for var in $(list_envvars "$slug"); do
eval "$var=\${_$var:-\${$var:-}}"
done
}
@@ -141,9 +141,9 @@ check_vars() {
local VAR
for VAR in "$@"; do
if [[ -z ${!VAR:-} ]]; then
- if [[ $(list_files $slug|wc -l) -gt 1 ]]; then
+ if [[ $(list_files "$slug"|wc -l) -gt 1 ]]; then
libremessages _l print "Configure '%s' in one of:" "$VAR"
- list_files $slug | sed 's/./ -> &/'
+ list_files "$slug" | sed 's/./ -> &/'
else
libremessages _l print "Configure '%s' in '%s'" "$VAR" "$(list_files "$slug")"
fi