cmd: Fix parsing positional args
authorAndrew Deason <adeason@sinenomine.net>
Mon, 23 May 2011 22:11:28 +0000 (17:11 -0500)
committerDerrick Brashear <shadow@dementia.org>
Tue, 24 May 2011 02:53:40 +0000 (19:53 -0700)
commit70624fd2ab0e580b7a34e0e9f3a83fc0d59b53c4
treee805df12d82ebe85926ba8bec16c8f2e7cd7a32e
parentba76149a57f0cfd92672580b7047a557f159ee52
cmd: Fix parsing positional args

If the first parameter of a libcmd syntax is a flag, cmd_Parse was
skipping over positional arguments, since j will be 0 at this point
(the j variable is only used if we're processing an explicit switch).
Effectively revert this area to what it was before
a2f1ca5fd52ac2fb7e68b101bbe3da9878c10474 so such positional parameters
work again.

Also move the j variable to inside the only block in which it is used,
to try and avoid such mistakes in the future.

Change-Id: Ifa52cecf50a3f561c70de351a9ebd026e90eeeab
Reviewed-on: http://gerrit.openafs.org/4711
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
src/cmd/cmd.c