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

Re: In POSIX mode, ${#var} measures length in bytes, not characters



On Tue, 9 Jun 2015 08:37:05 -0700
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> On Tuesday, June 9, 2015, Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> >
> >
> > I can't remember why POSIX_ARGZERO isn't on, or even if there was
> > actually a reason.
> >
> >
> The doc actually does explain this, for once.
> 
> For compatibility with previous versions of the shell, emulations use
> NO_FUNCTION_ARGZERO instead of POSIX_ARGZERO, which may result in
> unexpected scoping of $0 if the emulation mode is changed inside a function
> or script.

So we'd have to special-case the top-level emulation on the assumption
once a sh, always a sh.  Not clear if it's worth it.

pws



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