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

Re: `foo=foo; (( foo ))' => infinite recursion



On Mar 13, 10:34am, Sven Wischnowsky wrote:
} Subject: Re: `foo=foo; (( foo ))' => infinite recursion
}
} What really irritated me was that getnumvalue() called matheval().
} That meant that in cases like the one above $foo could contain any
} mathematical expression and that would get evaluated.

Urgh.  This is ugly, but appears to have been done for a long time, so
I'm a bit leery of changing it.  (( foo == $foo )) is probably meant to
be true, which won't be the case any more with your patch.

Maybe just a recursion counter with a reasonably large limit?

} One question: currently it only skips white space at the beginning of 
} $foo to find the number (btw, all number-formats zsh knows of should
} be understood); should we make it skip all non-numeric characters?

No, I don't think so.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com



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