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

Re: Any comment on users/15442 ?

/* Er, yeah. */

> } host# IFS=
> } host# set - "a b" "c   d" e$'\0'f 'gxh'
> } host# setopt sh_wordsplit
> } host# print -l $*
> } a bc   defgxh
> This might in fact be a bug.  Fix (?) below; everyone but PWS can stop
> reading when their eyes begin to glaze over, as this is zsh-workers
> material.  I took the approach of basing this on emulation mode rather
> than on the SH_WORD_SPLIT option, to minimize zsh-mode disruption, but
> that can easily be adjusted.

I think the option would be better.  I'm not very keen on things that
can only be adjusted by changing the entire emulation.  Anything
beginning "SH_" means "do this like sh, you are now leaving the world of
zsh", in my book [it's still selling], so the usual guarantees that we
won't change the behaviour are superseded by sh compatibility.  That
also makes it easier to test.

> The following implements the ksh-equivalent behavior by initializing the
> state of the (@) flag based upon the value of $IFS when we are in sh/ksh
> emulation mode, and then by requiring later joining to pay attention.
> However, it also has the side-effect of changing the behavior of ${=...}
> in a related way.

I doubt that's a problem.  I think they should split in the same way.
We're now in sh-land using a zsh-specific feature with an unusual
setting for IFS.  It probably just needs to follow sh behaviour.

> There no longer is a chunk marked "YUK" that I can find so I'm not sure
> what either of these refers to.

I think this went when Wayne fixed up word splitting so it worked
properly on strings that occur inside braced parameter substitutions.
Look at the 4.2 branch if you want to see what it looked like before.
Hence many of the comments may be out of date.  It also may have made
isarr operate differently.

Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/

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