Summary: | getopt_long does *not* return (or indicate in any way) error condition (if occurred) to programmer. | ||
---|---|---|---|
Product: | glibc | Reporter: | Konstantin Andreev <yiarreshios> |
Component: | argparse | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED WONTFIX | ||
Severity: | normal | CC: | eblake, fweimer, glibc-bugs |
Priority: | P2 | Flags: | fweimer:
security-
|
Version: | 2.4 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Konstantin Andreev
2007-03-01 11:58:04 UTC
Though "getopt_long" points to an option in question in case of errors: 3) option doesn't allow an argument 4) option requires an argument ... by setting "optopt" variable, but leaves it's "longind" parameter untouched. This cause programmer either scan "longopts" array, or build one more "switch(...)" to find the option in question. So, "getopt_long" should be fixed to set "longind" The getopt_long interface is problematic in many ways, but it is unlikely that we'll ever add a different command line parsing facility to glibc, considering that there won't be any consensus what a replacement should look like or how it should behave. |