projects
/
live-boot-grml.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1879d83
)
Make trim_path() handle "/", and arbitrarily many consecutive /:es.
author
Tails developers
<amnesia@boum.org>
Tue, 20 Mar 2012 16:36:18 +0000
(17:36 +0100)
committer
Daniel Baumann
<daniel@debian.org>
Thu, 5 Apr 2012 05:49:58 +0000
(07:49 +0200)
scripts/live-helpers
patch
|
blob
|
history
diff --git
a/scripts/live-helpers
b/scripts/live-helpers
index
1f2fb80
..
75fc106
100644
(file)
--- 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 ()