From c13e1cbf65165174968d53a615f7ec96bc154976 Mon Sep 17 00:00:00 2001 From: Ralf Wildenhues Date: Sun, 1 Jul 2007 11:02:14 +0000 Subject: [PATCH] * gnulib-tool (self_abspathname): Fix algorithm to cope with empty components in $PATH, denoting '.'. --- ChangeLog | 7 +++++++ gnulib-tool | 10 ++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f365ea486..6a69486d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-07-01 Bruno Haible + Eric Blake + Ralf Wildenhues + + * gnulib-tool (self_abspathname): Fix algorithm to cope with + empty components in $PATH, denoting '.'. + 2007-07-01 Ralf Wildenhues * gnulib-tool: Fix indentation. diff --git a/gnulib-tool b/gnulib-tool index ed6979b15..5bc39c479 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -22,7 +22,7 @@ progname=$0 package=gnulib -cvsdatestamp='$Date: 2007-07-01 07:55:35 $' +cvsdatestamp='$Date: 2007-07-01 11:02:15 $' last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` nl=' @@ -888,9 +888,15 @@ case "$0" in */*) self_abspathname=`pwd`/"$0" ;; *) self_abspathname= + pathx=$PATH + case :$PATH: in + *::*) + pathx=`echo ":$PATH:" | sed -e 's/:::*/:.:/g' -e 's/^://' -e 's/:\$//'` + ;; + esac save_IFS=$IFS IFS=: - for d in $PATH; do + for d in $pathx; do IFS=$save_IFS test -z "$d" && d=. if test -x "$d/$0" && test ! -d "$d/$0"; then -- 2.11.0