http://bugzilla.novell.com/show_bug.cgi?id=456293
http://bugzilla.novell.com/show_bug.cgi?id=456293#c3
Ján Kupec changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |NEW
AssignedTo|jkupec@novell.com |pbaudis@novell.com
Severity|Minor |Normal
--- Comment #3 from Ján Kupec 2010-01-27 20:50:50 UTC ---
This is in fact a bug in glibc. If the optstring starts with "+:", it does not
return ':' for 'missing argument' error.
I did some debugging and i suspect this happens because the 'optstring'
variable is not incremented on each call to getopt/getopt_long, but only on the
first call:
getopt.c:405:
if (d->optind == 0 || !d->__initialized)
{
if (d->optind == 0)
d->optind = 1; /* Don't scan ARGV[0], the program name. */
optstring = _getopt_initialize (argc, argv, optstring, d,
posixly_correct);
d->__initialized = 1;
}
(there's ++optstring in _getopt_initialize)
And as a consequence, the code around getopt.c:1097 returns '?' for optstring
== "+:something":
if (optstring[0] == ':')
c = ':';
else
c = '?';
c is returned later.
Pasky, can you take over from here? :O)
--
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.