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

no_glob_subst fix for _hosts



Completion/User/_hosts has problems if /etc/hosts contains globbing
characters (e.g. `#', which is quite common).

It would be nice to get rid of _cache_hosts and use zstyle, but I
haven't had time to learn all the details yet.

Index: _hosts
===================================================================
RCS file: /projects/zsh/zsh/Completion/User/_hosts,v
retrieving revision 1.1.1.20
diff -u -r1.1.1.20 _hosts
--- _hosts	1999/12/10 14:47:58	1.1.1.20
+++ _hosts	1999/12/17 16:29:54
@@ -4,7 +4,7 @@
 
 if ! zstyle -a ":completion${curcontext}:hosts" hosts hosts; then
   (( $+_cache_hosts )) ||
-      : ${(A)_cache_hosts:=${(s: :)${(ps:\t:)${${(f)"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}}
+      : ${(A)_cache_hosts:=${(s: :)${(ps:\t:)${${(f)~~"$(</etc/hosts)"}%%\#*}##[:blank:]#[^[:blank:]]#}}}
 
   hosts=( "$_cache_hosts[@]" )
 fi



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