Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[zsh] ant completion broken



Hello.

I wish to report a problem about zsh-4.3.6, concerning the _ant
completion file. The zsh-workers/24129 fix breaks the ant completion for
target name.

In fact, the regular expression used in sed contains two spaces. And
since, in most of XML tags, the property separator is a single space,
the completion fails for many of build.xml files.

As a fix, deleting one of the two spaces from the regular expression
makes the ant completion working again. Also, replacing the remaining
single space by the POSIX [[:blank:]] pattern might provide a safer
parsing of the target name.

So, I send a patch file as attachment that fixes the _ant file.

Thank you for considering my report.

Regards.

PS: Does it matter if I ask to be Cc:ed for getting all replies?

-- 
David LE BOURGEOIS
E-mail : david.lebourgeois (at) free.fr
XMPP   : david.lebourgeois (at) jabber.fr
PGP    : http://david.lebourgeois.free.fr/pgp/
--- zsh-4.3.6/Completion/Unix/Command/_ant	2007-11-29 10:45:58.000000000 +0100
+++ zsh-4.3.6/Completion/Unix/Command/_ant.new	2008-08-31 10:42:55.000000000 +0200
@@ -10,7 +10,7 @@
     importedfiles=( $(sed -n "s/ *<import[^>]* file=[\"']\([^\"']*\)[\"'].*/\1/p" < $1) )
     # Tweaked to omit targets beginning with "-" that can't
     # be invoked from the command line; see zsh-workers/24129.
-    sed -n "s/ *<target[^>]*  name=[\"']\([^-][^\"']*\)[\"'].*/\1/p" $1
+    sed -n "s/ *<target[^>]*[[:blank:]]name=[\"']\([^-][^\"']*\)[\"'].*/\1/p" $1
     if (( $#importedfiles )) ; then
 	( cd $1:h
     	for file in $importedfiles ; do
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD4DBQBIumI6fGpn1bRTyEYRAhyBAKC3AWK5df2OveanWP88C+1JIAOyXwCXbCnq
sdJLBChTN6vYYuveJ+byag==
=diPn
-----END PGP SIGNATURE-----


Messages sorted by: Reverse Date, Date, Thread, Author