mirror of
https://github.com/fluencelabs/musl
synced 2025-05-30 16:11:40 +00:00
fix getopt_long_only misinterpreting "--" as an option
This commit is contained in:
parent
51ab6db4ed
commit
b24f1d2520
@ -53,7 +53,7 @@ static int __getopt_long_core(int argc, char *const *argv, const char *optstring
|
|||||||
{
|
{
|
||||||
optarg = 0;
|
optarg = 0;
|
||||||
if (longopts && argv[optind][0] == '-' &&
|
if (longopts && argv[optind][0] == '-' &&
|
||||||
((longonly && argv[optind][1]) ||
|
((longonly && argv[optind][1] && argv[optind][1] != '-') ||
|
||||||
(argv[optind][1] == '-' && argv[optind][2])))
|
(argv[optind][1] == '-' && argv[optind][2])))
|
||||||
{
|
{
|
||||||
int colon = optstring[optstring[0]=='+'||optstring[0]=='-']==':';
|
int colon = optstring[optstring[0]=='+'||optstring[0]=='-']==':';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user