Bug 71147 - The flag POPT_ARGFLAG_OPTIONAL is not handled correctly
Summary: The flag POPT_ARGFLAG_OPTIONAL is not handled correctly
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-09 09:59 UTC by Wensong Zhang
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-02-12 20:55:07 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
A simple fix, hope that it doesn't break things. :) (793 bytes, patch)
2002-08-09 10:01 UTC, Wensong Zhang
no flags Details | Diff

Description Wensong Zhang 2002-08-09 09:59:24 UTC
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:

Comment 1 Wensong Zhang 2002-08-09 10:01:24 UTC
Created attachment 69704 [details]
A simple fix, hope that it doesn't break things. :)

Comment 2 Paul Nasrat 2005-06-07 21:00:44 UTC
Thanks for the patch, I've raised on rpm-devel list

Comment 3 Jeff Johnson 2006-02-12 20:55:07 UTC
Patch checked in, should be in popt-1.10.5-0.11 when built.


Note You need to log in before you can comment on or make changes to this bug.