about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_ant5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index cfc74a3a3..809266fdc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-02-25  Oliver Kiddle  <opk@zsh.org>
+
+	* 20867: Completion/Unix/Command/_ant: handle imported files
+	that are specified using a relative path
+
 2005-02-24  Peter Stephenson  <pws@pwstephenson.fsnet.co.uk>
 
 	* 20866: Src/Zle/zle_misc.c: two mistakes in 20861.
diff --git a/Completion/Unix/Command/_ant b/Completion/Unix/Command/_ant
index 184278662..6ef0e733d 100644
--- a/Completion/Unix/Command/_ant
+++ b/Completion/Unix/Command/_ant
@@ -88,8 +88,9 @@ case $state in
       fi
       if [[ -f $buildfile ]]; then
         importedfiles=( $(sed -n "s/ *<import[^>]* file=[\"']\([^\"']*\)[\"'].*/\1/p" < $buildfile) )
-        targets=( $(cat $buildfile $importedfiles |
-	    sed -n "s/ *<target[^>]* name=[\"']\([^\"']*\)[\"'].*/\1/p" ) )
+        targets=( $(sed -n "s/ *<target[^>]* name=[\"']\([^\"']*\)[\"'].*/\1/p" $buildfile) )
+        (( $#importedfiles )) && targets+=( $(cd $buildfile:h;
+	    sed -n "s/ *<target[^>]* name=[\"']\([^\"']*\)[\"'].*/\1/p" $importedfiles) )
 	_wanted targets expl target compadd -a targets && ret=0
       else
 	_message -e targets target