zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: compdump variables
@ 2008-07-29  8:56 Peter Stephenson
  0 siblings, 0 replies; only message in thread
From: Peter Stephenson @ 2008-07-29  8:56 UTC (permalink / raw)
  To: Zsh hackers list

I spotted this with WARN_CREATE_GLOBAL.  I don't think any of these
should be global, and one use of one of the variables was obviously
wrong.

Index: Completion/compdump
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/compdump,v
retrieving revision 1.8
diff -u -r1.8 compdump
--- Completion/compdump	6 Jun 2007 08:49:52 -0000	1.8
+++ Completion/compdump	29 Jul 2008 08:54:29 -0000
@@ -79,13 +79,13 @@
 # argument to zle does not begin with a `_').
 
 _d_bks=()
-_d_complist=
+typeset _d_complist=
 zle -lL |
   while read -rA _d_line; do
     if [[ ${_d_line[3]} = _* && ${_d_line[5]} = _* ]]; then
       if [[ -z "$_d_complist" && ${_d_line[4]} = .menu-select ]]; then
         print 'zmodload -i zsh/complist'
-	d_complist=yes
+	_d_complist=yes
       fi
       print -r - ${_d_line}
       _d_bks+=(${_d_line[3]})
@@ -107,7 +107,7 @@
 
 # print them out:  about five to a line looks neat
 
-_i=5
+integer _i=5
 print -n autoload -Uz >> $_d_file
 while (( $#_d_als )); do
   if (( ! $+_compautos[$_d_als[1]] )); then
@@ -122,8 +122,9 @@
 
 print >> $_d_file
 
-for _i in "${(ok@)_compautos}"; do
-  print "autoload -Uz $_compautos[$_i] $_i" >> $_d_file
+local _c
+for _c in "${(ok@)_compautos}"; do
+  print "autoload -Uz $_compautos[$_c] $_c" >> $_d_file
 done
 
 print >> $_d_file


-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-07-29  8:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-29  8:56 PATCH: compdump variables Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).