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

Bug in compdef()



Hi,

there seems to be a bug in compdef that prevents more than three
commands from using the same completion service.  The problem can be
illustrated by the following commands:

  $ compdef foo=mount
  $ compdef bar=mount
  $ compdef baz=mount
  compdef: unknown command or service: mount

The cause of this error is an invalid use of the 'R' array subscript
flag.  The following patch fixes the issue.

Best regards
Frank Benkstein.

diff -ur zsh-4.3.4/Completion/compinit zsh-4.3.4.fixed/Completion/compinit
--- zsh-4.3.4/Completion/compinit	2006-11-01 13:25:22.000000000 +0100
+++ zsh-4.3.4.fixed/Completion/compinit	2007-11-01 11:22:16.739402608 +0100
@@ -271,7 +271,7 @@
         if [[ "$1" = *\=* ]]; then
 	  cmd="${1%%\=*}"
 	  svc="${1#*\=}"
-          func="$_comps[${_services[(R)$svc]:-$svc}]"
+          func="$_comps[${_services[(r)$svc]:-$svc}]"
           [[ -n ${_services[$svc]} ]] &&
               svc=${_services[$svc]}
 	  [[ -z "$func" ]] &&

-- 
GPG (Mail): 7093 7A43 CC40 463A 5564  599B 88F6 D625 BE63 866F
GPG (XMPP): 2243 DBBA F234 7C5A 6D71  3983 9F28 4D03 7110 6D51

Attachment: signature.asc
Description: OpenPGP digital signature



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