diff options
author | merakor <cem@ckyln.com> | 2020-08-16 23:14:08 +0000 |
---|---|---|
committer | merakor <cem@ckyln.com> | 2020-08-16 23:14:08 +0000 |
commit | 5287d503590a87e06207457f27059fc941275cf4 (patch) | |
tree | 6fbfc83978527e9eceb9d5d57860554b21a10b73 /src | |
parent | 2573d51bcfdf34b55f86c8f5fae5bcdefd8e2261 (diff) | |
download | cpt-5287d503590a87e06207457f27059fc941275cf4.tar.gz |
cpt-lib: revert to the old IFS switching method.
FossilOrigin-Name: 787c813088a11f4079d8e63269f81a0721e42ed52581288af7ed7540019ca6fb
Diffstat (limited to 'src')
-rw-r--r-- | src/cpt-lib | 7 |
1 files changed, 5 insertions, 2 deletions
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##*/}" ] || { |