diff options
| author | Tails developers <amnesia@boum.org> | 2012-03-20 17:36:18 +0100 |
|---|---|---|
| committer | Daniel Baumann <daniel@debian.org> | 2012-04-05 07:49:58 +0200 |
| commit | 2d129205223e1fb6322bb03a9cb9fdf1736885b8 (patch) | |
| tree | b1d6865801302bf383604df807b59bf30d705a96 /scripts | |
| parent | 1879d835a5b10728f3c49dc04ec854f2ff993a8b (diff) | |
| download | live-boot-2d129205223e1fb6322bb03a9cb9fdf1736885b8.tar.gz live-boot-2d129205223e1fb6322bb03a9cb9fdf1736885b8.zip | |
Make trim_path() handle "/", and arbitrarily many consecutive /:es.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/live-helpers | 5 |
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 () |
