summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/live-helpers5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/live-helpers b/scripts/live-helpers
index 1f2fb80..75fc106 100644
--- a/scripts/live-helpers
+++ b/scripts/live-helpers
@@ -519,8 +519,9 @@ where_is_mounted ()
}
trim_path () {
- # remove all unnecessary /:s in the path, including last
- echo ${1} | sed 's|//|/|g' | sed 's|/$||'
+ # remove all unnecessary /:s in the path, including last one (except
+ # if path is just "/")
+ echo ${1} | sed 's|//\+|/|g' | sed 's|^\(.*[^/]\)/$|\1|'
}
what_is_mounted_on ()