diff options
author | Ulrich Müller <ulm@gentoo.org> | 2023-06-05 19:47:02 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2023-06-05 19:47:02 +0200 |
commit | 58e82125a8adfa89585468f3e6609f46896d313a (patch) | |
tree | 0d657a784d1a9ed08b1ab15dbdb8f39dabbc507c /bin | |
parent | Add subsection about module testing to developer guide (diff) | |
download | eselect-58e82125a8adfa89585468f3e6609f46896d313a.tar.gz eselect-58e82125a8adfa89585468f3e6609f46896d313a.tar.bz2 eselect-58e82125a8adfa89585468f3e6609f46896d313a.zip |
Quote argument of ":" command
* bin/eselect.in (EPREFIX): Quote argument of ":" command.
This avoids globbing, see: https://www.shellcheck.net/wiki/SC2223
Add some more quotes throughout.
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/eselect.in | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/eselect.in b/bin/eselect.in index 9109627..c59a09d 100755 --- a/bin/eselect.in +++ b/bin/eselect.in @@ -45,7 +45,7 @@ ESELECT_KILL_TARGET="$$" # prefix for the build host. EPREFIX defaults to the same, but can be # overridden at runtime when building for a different prefix. BROOT="@EPREFIX@" -: ${EPREFIX="${BROOT}"} +: "${EPREFIX="${BROOT}"}" EROOT="${ROOT%${EPREFIX:+/}}${EPREFIX}" # Remove all alias definitions. Unset functions and variables that are @@ -126,7 +126,7 @@ unset suffix if [[ -z ${action} ]]; then binname=$(basename "$0") for prefix in config update{,r} manage 'read'; do - if [[ ${binname##${prefix}-} != ${binname} ]]; then + if [[ ${binname##${prefix}-} != "${binname}" ]]; then action=$(basename "$0") action=${action##${prefix}-} break @@ -145,7 +145,7 @@ while [[ ${1##--} != "$1" ]]; do colour=*|color=*|colour|color) # accept all arguments that are valid for ls or emerge case ${1#*=} in - yes|y|always|force|$1) colour=yes ;; + yes|y|always|force|"$1") colour=yes ;; no|n|never|none) colour=no ;; auto|tty|if-tty) colour="" ;; *) die -q "Invalid argument for ${1%%=*} option" ;; |