aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2021-08-10 22:18:35 +0000
committermerakor <cem@ckyln.com>2021-08-10 22:18:35 +0000
commit4b09b2fcfa249232c1d60d851a28aaabc9b9b7e8 (patch)
tree6e028b12a52c44677893c963c5244e97c5a0f2be
parentfcc7cdd594dd8b8aed6997449d326183d4a162bc (diff)
downloadcpt-4b09b2fcfa249232c1d60d851a28aaabc9b9b7e8.tar.gz
cpt-lib: use a better way of trimming slashes on CPT_ROOT
FossilOrigin-Name: d25b1bf25a26fc22560d057530e4ca89fde8e9d87838c590c0eb6e4367842264
-rw-r--r--src/cpt-lib.in5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/cpt-lib.in b/src/cpt-lib.in
index 41daf05..adfcb0c 100644
--- a/src/cpt-lib.in
+++ b/src/cpt-lib.in
@@ -2205,10 +2205,7 @@ create_cache() {
# Make sure that the CPT_ROOT doesn't end with a '/'. This might
# break some operations.
- [ -z "$CPT_ROOT" ] || [ "${CPT_ROOT##*/}" ] || {
- warn "" "Your CPT_ROOT variable shouldn't end with '/'"
- CPT_ROOT=${CPT_ROOT%/}
- }
+ CPT_ROOT=${CPT_ROOT%"${CPT_ROOT##*[!/]}"}
# Define an optional sys_arch variable in order to provide
# information to build files with architectural information.