diff options
author | Ulrich Mueller <ulm@gentoo.org> | 2010-08-30 14:35:32 +0200 |
---|---|---|
committer | Ulrich Mueller <ulm@gentoo.org> | 2010-08-30 15:23:34 +0200 |
commit | bb2a3affe726d41a8a045c76c81d08b331bd16c4 (patch) | |
tree | 64c56f62c4988ca26c36a3be886114fe85aad6ac | |
parent | e9c6c8752f9fddd4def7538a93b51770a297ed0a (diff) | |
download | portage-bb2a3affe726d41a8a045c76c81d08b331bd16c4.tar.gz portage-bb2a3affe726d41a8a045c76c81d08b331bd16c4.tar.bz2 portage-bb2a3affe726d41a8a045c76c81d08b331bd16c4.zip |
Bug fix in canonicalize() function.
-rwxr-xr-x | bin/misc-functions.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh index 6f3604d0a..d7e0f5688 100755 --- a/bin/misc-functions.sh +++ b/bin/misc-functions.sh @@ -43,10 +43,10 @@ install_symlink_html_docs() { # replacement for "readlink -f" or "realpath" canonicalize() { local f=$1 b n=10 wd=$(pwd) - while [[ ${f: -1} = / && ${#f} -gt 1 ]]; do - f=${f%/} - done while (( n-- > 0 )); do + while [[ ${f: -1} = / && ${#f} -gt 1 ]]; do + f=${f%/} + done b=${f##*/} cd "${f%"${b}"}" 2>/dev/null || break if [[ ! -L ${b} ]]; then |