From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020707 Description of problem: When an option is specified with flag POPT_ARGFLAG_OPTIONAL, the argument will be set if there is one, and the argumenet will be set NULL if there is no arg. However, the current popt will not take the option as the argument, if there is an option following the POPT_ARGFLAG_OPTIONAL option with no arg. This is not correct. Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: Take the test1 progarm shipped inside the popt as example [wensong@exchange popt]$ ./test1 --int 1 --optional arg1: 0 arg2: (none) aInt: 1 oStr: (none) This one is correct. [wensong@exchange popt]$ ./test1 --optional --int 1 arg1: 0 arg2: (none) oStr: --int rest: 1 It takes "--int" as the argument of the --optional. It's wrong. Additional info:
Created attachment 69704 [details] A simple fix, hope that it doesn't break things. :)
Thanks for the patch, I've raised on rpm-devel list
Patch checked in, should be in popt-1.10.5-0.11 when built.