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

Re: PATCH: 3.1.6-pws-3: more getopts bugs



Bart Schaefer wrote:
>This also works as expected in 3.0.6.  I wonder what bugs Zefram removed?

I don't remember exactly; ISTR there being a bunch of fencepost errors,
error handling errors, errors handling unusual cases and so on.  The code
was so messy that it was easier to start from scratch -- most patches
to that code were introducing new errors while fixing the old ones.
Of course, getopts is a particularly bad design, so the code can't help
being messy to some extent.

>Restarting on OPTIND=0 must be one of the bugs Zefram fixed, but maybe
>he shouldn't have taken out the reset of optcind upon failure return?

Probably.  I remember having some difficulty working out where optcind
should be reset -- it's all very implicit in the POSIX definition.

-zefram



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