zsh-workers
 help / color / mirror / code / Atom feed
* Bug report
@ 2014-12-26 16:53 mvxxc
  2014-12-27  2:35 ` Bart Schaefer
  0 siblings, 1 reply; 6+ messages in thread
From: mvxxc @ 2014-12-26 16:53 UTC (permalink / raw)
  To: zsh-workers

If the following script is run in an empty directory, zsh executes the defined
function only once.

  #!/usr/bin/zsh
  
  set -e
  setopt NULL_GLOB
  
  func () {for i in _*; do echo $i; done; echo _;} 
  
  func
  if false; then
    :
  else
    func
  fi  

After adding one line, the function is executed twice.

  [...]
  else
    :
    func
  fi

"set -e" and "NULL_GLOB" seem to affect both function calls in a different way.
This could be a bug, as the answer to my question on Stack Overflow suggests.

  https://stackoverflow.com/questions/27648773.

MVXXC


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-01-02 20:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-26 16:53 Bug report mvxxc
2014-12-27  2:35 ` Bart Schaefer
2014-12-28  0:32   ` [PATCH] ERR_EXIT with "for" loops and shell functions (Re: Bug report) Bart Schaefer
2015-01-02 16:56     ` Peter Stephenson
2015-01-02 18:56       ` Bart Schaefer
2015-01-02 20:15         ` 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).