From 366ab13e3bb245cfde0f3e3ed11675bce8f9c8a0 Mon Sep 17 00:00:00 2001 From: "seawood%netscape.com" Date: Thu, 13 Jun 2002 12:16:52 +0000 Subject: [PATCH] Fix symlink detection (again) so that relative symlinks work and the binary is executed from the cwd, not the installation directory. Thanks to Andrew Schultz for the patch. Bug #57866 r=cls --- xpfe/bootstrap/mozilla.in | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/xpfe/bootstrap/mozilla.in b/xpfe/bootstrap/mozilla.in index 80a95421bfe..e7d0f1039ae 100755 --- a/xpfe/bootstrap/mozilla.in +++ b/xpfe/bootstrap/mozilla.in @@ -16,7 +16,7 @@ # Reserved. # -## $Id: mozilla.in,v 1.1 2002-04-25 02:51:10 seawood%netscape.com Exp $ +## $Id: mozilla.in,v 1.2 2002-06-13 12:16:52 seawood%netscape.com Exp $ ## ## Usage: ## @@ -50,19 +50,20 @@ else found=1 else here=`/bin/pwd` - until test $found != 0 -o ! -L "$progname" ; do + while [ -h "$progname" ]; do + bn=`basename "$progname"` + cd `dirname "$progname"` + progname=`/bin/ls -l "$bn" |sed -e 's/^.* -> //' ` + if [ ! -x "$progname" ]; then + break + fi + curdir=`dirname $progname` run_moz="$curdir/run-mozilla.sh" if [ -x $run_moz ]; then - dist_bin=$curdir + cd $curdir + dist_bin=`pwd` found=1 - else - bn=`basename "$progname"` - cd `dirname "$progname"` - progname=`/bin/ls -l "$bn" |sed -e 's/^.* -> //' ` - if [ ! -x "$progname" ]; then - break - fi - curdir=`dirname $progname` + break fi done cd $here