This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/2714] New: Contradiction in the implementation of optional arguments in getopt()
- From: "alpt at freaknet dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 31 May 2006 10:37:43 -0000
- Subject: [Bug libc/2714] New: Contradiction in the implementation of optional arguments in getopt()
- Reply-to: sourceware-bugzilla at sourceware dot org
Hi there,
this is the problem:
foo -abcRdefg
If 'R' is an element that specifies an optional argument, then the "defg"
string is taken as its argument, it is pointed by optarg,
but this is not what the user wants, in fact, he expects that the "defg"
characters are parsed as other option elements. In other words the user
expects this:
foo -abc -R -defg
The solution is to assign arguments to 'R' only in these cases:
foo -abcR option_to_R
bar -abc -R option_to_R
The patch is here:
http://freaknet.org/alpt/src/patches/getopt-opt-arg/getopt-option-arg.patch
--
Summary: Contradiction in the implementation of optional
arguments in getopt()
Product: glibc
Version: 2.4
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: alpt at freaknet dot org
CC: alpt at freaknet dot org,glibc-bugs at sources dot
redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=2714
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.