optind should be 0 when reiterating the argument list.

Well, this is embarrassing.

(cherry picked from commit 0979874f775b0673c17fb5fe13920f0bb3271427)