From 7bc3a0eb92f9c13217841832cbff44cb2a81e6da Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 23 Sep 2020 21:56:30 +0300 Subject: [PATCH] kiss: strip all trailing slashes from KISS_ROOT. thanks E5ten --- kiss | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/kiss b/kiss index b2d6cf1..b529090 100755 --- a/kiss +++ b/kiss @@ -1515,10 +1515,8 @@ main() { # This is used enough to warrant a place here. uid=$(id -u) - # (lazily) ensure that the KISS_ROOT doesn't end with a '/'. - KISS_ROOT=${KISS_ROOT%/} - KISS_ROOT=${KISS_ROOT%/} - KISS_ROOT=${KISS_ROOT%/} + # Ensure that the KISS_ROOT doesn't end with a '/'. + KISS_ROOT=${KISS_ROOT%"${KISS_ROOT##*[!/]}"} # Define some paths which we will then use throughout the script. sys_db=$KISS_ROOT/${pkg_db:=var/db/kiss/installed}