summaryrefslogtreecommitdiff
path: root/extra/scripts/relative_path.sh
diff options
context:
space:
mode:
Diffstat (limited to 'extra/scripts/relative_path.sh')
-rwxr-xr-xextra/scripts/relative_path.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/extra/scripts/relative_path.sh b/extra/scripts/relative_path.sh
index c859646a4..4dddefac1 100755
--- a/extra/scripts/relative_path.sh
+++ b/extra/scripts/relative_path.sh
@@ -33,7 +33,10 @@ case $from in
;;
esac
-prefix=`echo $from///$target | sed 's,\(\(/[^/]*\)*\).*///\1.*,\1,'`
+# Without trailing slash, from=/usr/lib and target=/uclibc/lib
+# mistakenly concludes that prefix=/u
+#prefix=`echo $from///$target | sed 's,\(\(/[^/]*\)*\).*///\1.*,\1,'`
+prefix=`echo $from///$target | sed 's,\(\(/[^/]*\)*/\).*///\1.*,\1,'`
dots=`echo $prefix | sed s,.,.,g`
from=`echo $from | sed "s,^$dots,,"`
target=`echo $target | sed "s,^$dots,,"`