ossp-pkg/shtool/sh.mkln 1.25 -> 1.26
--- sh.mkln 2008/06/06 12:15:11 1.25
+++ sh.mkln 2008/12/23 19:12:05 1.26
@@ -114,14 +114,14 @@
dstdir=""
else
while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do
- presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'`
- predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'`
+ presrc=`echo $srcdir | sed -e 's;^\([^/][^/]*\)/.*;\1;'`
+ predst=`echo $dstdir | sed -e 's;^\([^/][^/]*\)/.*;\1;'`
if [ ".$presrc" != ".$predst" ]; then
break
fi
prefix="$prefix$presrc/"
- srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'`
- dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'`
+ srcdir=`echo $srcdir | sed -e 's;^[^/][^/]*/*;;'`
+ dstdir=`echo $dstdir | sed -e 's;^[^/][^/]*/*;;'`
done
fi
@@ -165,6 +165,11 @@
fi
fi
+ # special case (usually on "mkln -s /foo /foo/bar", etc)
+ if [ ".$srcpre$srcdir$srcbase" = . ]; then
+ srcdir="."
+ fi
+
# now finalize source and destination directory paths
srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'`
dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'`
|
|