touchup syntax and dont execute the loop as many times
authorMike Frysinger <vapier@gentoo.org>
Sat, 15 Apr 2006 19:29:52 +0000 (19:29 -0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 15 Apr 2006 19:29:52 +0000 (19:29 -0000)
svn path=/main/trunk/; revision=3158

bin/ebuild.sh

index f54110273baadb53d5da281050afae8bb4bc4ece..3babf1d46020bdad774546db8427289425575115 100755 (executable)
@@ -409,11 +409,11 @@ unpack() {
        chmod -Rf a+rX,u+w,g-w,o-w .
 }
 
-strip_duplicate_slashes () {
-       if [ -n "${1}" ]; then
-               local removed=${1}
-               while [ "${removed}" != "${removed/\/\///}" ] ; do
-                       removed="${removed/\/\///}"
+strip_duplicate_slashes() {
+       if [[ -n $1 ]] ; then
+               local removed=$1
+               while [[ ${removed} == *//* ]] ; do
+                       removed=${removed//\/\///}
                done
                echo ${removed}
        fi