From 5287d503590a87e06207457f27059fc941275cf4 Mon Sep 17 00:00:00 2001 From: merakor Date: Sun, 16 Aug 2020 23:14:08 +0000 Subject: cpt-lib: revert to the old IFS switching method. FossilOrigin-Name: 787c813088a11f4079d8e63269f81a0721e42ed52581288af7ed7540019ca6fb --- src/cpt-lib | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cpt-lib b/src/cpt-lib index a975a64..c841da1 100644 --- a/src/cpt-lib +++ b/src/cpt-lib @@ -198,7 +198,7 @@ pkg_find() { done done - unset IFS + 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. @@ -1267,7 +1267,7 @@ pkg_fetch() { # Create a list of all repositories. # See [1] at top of script. # shellcheck disable=2046,2086 - { IFS=:; set -- $CPT_PATH; unset IFS; } + { IFS=:; set -- $CPT_PATH; IFS=$old_ifs ;} # Update each repository in '$CPT_PATH'. It is assumed that # each repository is 'git' tracked. @@ -1517,6 +1517,9 @@ main() { # This is used enough to warrant a place here. uid=$(id -u) + # Save IFS, so we can restore it back to what it was before. + old_ifs=$IFS + # Make sure that the CPT_ROOT doesn't end with a '/'. This might # break some operations. [ -z "$CPT_ROOT" ] || [ "${CPT_ROOT##*/}" ] || { -- cgit v1.2.3