diff options
author | merakor <cem@ckyln.com> | 2020-04-20 13:31:28 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2020-04-20 13:31:28 +0000 |
commit | 55fa26cdb7c4b25e6ddceec0d3bd630013efbbd7 (patch) | |
tree | 1a37e7a75aa7cdc755910686a0bac681e371664d /kiss | |
parent | 7bcf8b087c15a9b5d72021e3110e9cf4166e8cb5 (diff) | |
download | cpt-55fa26cdb7c4b25e6ddceec0d3bd630013efbbd7.tar.gz |
kiss: don't use old_ifs
FossilOrigin-Name: 669c16656853a5482a6df95683cb02d253a7149be0a9ccd3cb400bd474a7aea3
Diffstat (limited to 'kiss')
-rwxr-xr-x | kiss | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -120,11 +120,13 @@ pkg_find() { # Figure out which repository a package belongs to by # searching for directories matching the package name # in $KISS_PATH/*. - query=$1 match=$2 IFS=:; set -- + query=$1 match=$2 # Word splitting is intentional here. # shellcheck disable=2086 - for path in $KISS_PATH "$sys_db" ; do + IFS=: set -- $KISS_PATH "$sys_db"; searchpath="$*" ; set -- + + for path in $searchpath; do set +f for path2 in "$path/"$query; do @@ -132,8 +134,6 @@ pkg_find() { done done - IFS=$old_ifs - # A package may also not be found due to a repository not being # readable by the current user. Either way, we need to die here. [ "$1" ] || die "Package '$query' not in any repository" @@ -1072,8 +1072,8 @@ pkg_fetch() { # Create a list of all repositories. # See [1] at top of script. - # shellcheck disable=2046,2086 - { IFS=:; set -- $KISS_PATH; IFS=$old_ifs; } + # shellcheck disable=2086 + { IFS=: set -- $KISS_PATH; } # Update each repository in '$KISS_PATH'. It is assumed that # each repository is 'git' tracked. @@ -1389,10 +1389,6 @@ main() { # that it doesn't change beneath us. pid=${KISS_PID:-$$} - # Store the original value of IFS so we can revert back to it if the - # variable is ever changed. - old_ifs=$IFS - # Force the C locale to speed up things like 'grep' which disable unicode # etc when this is set. We don't need unicode and a speed up is always # welcome. |