aboutsummaryrefslogtreecommitdiffstats
path: root/util/mklink.sh
diff options
context:
space:
mode:
Diffstat (limited to 'util/mklink.sh')
-rwxr-xr-xutil/mklink.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/util/mklink.sh b/util/mklink.sh
index 015586a9c3..3eeba67b2e 100755
--- a/util/mklink.sh
+++ b/util/mklink.sh
@@ -12,6 +12,15 @@ shift
here=`pwd`
tmp=`dirname $from`
+prefix='..'
+
+while [ `basename $tmp`x != ..x -a `basename $tmp`x != .x ]
+do
+ prefix=../$prefix
+ tmp=`dirname $tmp`
+done
+
+to=''
while [ "$tmp"x != "x" -a "$tmp"x != ".x" ]
do
t=`basename $here`
@@ -19,7 +28,7 @@ do
to="/$t$to"
tmp=`dirname $tmp`
done
-to=..$to
+to=$prefix$to
if [ "$*"x != "x" ]; then
for i in $*