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

Re: Tar file and Re: Bad interaction between -iprefix and -string



Bart Schaefer wrote:

> On Feb 11,  6:08pm, Peter Stephenson wrote:
> } Subject: Re: Tar file and Re: Bad interaction between -iprefix and -string
> }
> } [...]  for some reason
> } 
> } for i in "$patcomps[@]"; do
> } 
> } was being called when patcomps was empty (should it really do that?)
> 
> Hmm.  You mean the for loop, looped?  Obviously it shouldn't do that.
> How was patcomps initialized up to that point?

The array isn't initialised at all, look:

  % foo() { echo $# }
  % unset a
  % foo $a[@]
  0                    # fine
  % foo "$a[@]"
  1                    # oops

The same for `$a[*]' and `$a'.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



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