Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
no_glob_subst fix for _hosts
- X-seq: zsh-workers 9109
 
- From: Adam Spiers <adam@xxxxxxxxxx>
 
- To: zsh workers mailing list <zsh-workers@xxxxxxxxxxxxxx>
 
- Subject: no_glob_subst fix for _hosts
 
- Date: Fri, 17 Dec 1999 16:33:03 +0000
 
- Mail-followup-to: zsh workers mailing list <zsh-workers@xxxxxxxxxxxxxx>
 
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
 
- Reply-to: Adam Spiers <adam@xxxxxxxxxx>
 
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