From 80746975a8bb5a124447ea359ccfb179afe69704 Mon Sep 17 00:00:00 2001 From: Mark Eichin Date: Mon, 27 Feb 1995 05:03:24 +0000 Subject: [PATCH] make lndir work with relative path invocation git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5001 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/ChangeLog | 5 +++++ src/util/lndir | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/util/ChangeLog b/src/util/ChangeLog index 686c57405..4ec6f8561 100644 --- a/src/util/ChangeLog +++ b/src/util/ChangeLog @@ -1,3 +1,8 @@ +Mon Feb 27 00:01:41 1995 Mark Eichin + + * lndir: if $0 contains slashes, but does not have a leading + slash, prepend `pwd` so that relative invocation works. + Fri Feb 3 16:50:07 1995 Theodore Y. Ts'o (tytso@dcl) * reconf: If util/autoconf isn't built, try to use autoconf diff --git a/src/util/lndir b/src/util/lndir index e12503e1d..89416f5e7 100644 --- a/src/util/lndir +++ b/src/util/lndir @@ -30,6 +30,12 @@ USAGE="Usage: $0 fromdir [todir]" +case $0 in +/*) lndir=$0 ;; +*/*) lndir=`pwd`/$0 ;; +*) lndir=$0 ;; +esac + if [ $# -lt 1 -o $# -gt 2 ] then echo "$USAGE" @@ -90,7 +96,7 @@ do echo "$pwd: FROM and TO are identical!" exit 1 fi - $0 $DIRFROM/$file + $lndir $DIRFROM/$file ) fi fi -- 2.26.2