zsh-users
 help / color / mirror / code / Atom feed
* set -o nounset; foo=(); print ${foo:#bar}
@ 2014-09-06 18:47 Roman Neuhauser
  2014-09-06 19:34 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Roman Neuhauser @ 2014-09-06 18:47 UTC (permalink / raw)
  To: zsh-users

hello,

i encountered a behavior i don't like and would like to get rid of. :)

  roman@wrench ~ 0 1074 0 > print $ZSH_VERSION
  5.0.5
  roman@wrench ~ 0 1075 0 > set -o nounset
  roman@wrench ~ 0 1076 0 > foo=()
  roman@wrench ~ 0 1077 0 > print $foo

  roman@wrench ~ 0 1078 0 > print ${foo:#bar}
  zsh: foo: parameter not set
  roman@wrench ~ 0 1079 1 > 

the problematic part is ${foo:#bar} triggering nounset.  FMPOV it *is*
set (but null), so i'd say the observed behavior is a bug.

is it fixable?  or is there at least a good workaround?  (stuffing the
array with a sentry is not a good workaround.)

-- 
roman


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

end of thread, other threads:[~2014-09-06 20:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-06 18:47 set -o nounset; foo=(); print ${foo:#bar} Roman Neuhauser
2014-09-06 19:34 ` Bart Schaefer
2014-09-06 20:13   ` Roman Neuhauser

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).