From: Mike Frysinger Date: Sat, 15 Apr 2006 19:29:52 +0000 (-0000) Subject: touchup syntax and dont execute the loop as many times X-Git-Tag: v2.1_pre9~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=70effbe19e6c95eee21db8d164c65e8bcd90cde2;p=portage.git touchup syntax and dont execute the loop as many times svn path=/main/trunk/; revision=3158 --- diff --git a/bin/ebuild.sh b/bin/ebuild.sh index f54110273..3babf1d46 100755 --- a/bin/ebuild.sh +++ b/bin/ebuild.sh @@ -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