mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 13:20:30 +00:00
Update optind correctly in getopt_long().
This commit is contained in:
parent
1dfcc8a2b0
commit
aea523c418
@ -160,12 +160,13 @@ int getopt_long(int argc, char *argv[],
|
|||||||
const char *optstring, const struct option *longopts, int *longindex)
|
const char *optstring, const struct option *longopts, int *longindex)
|
||||||
{
|
{
|
||||||
(void)longindex;
|
(void)longindex;
|
||||||
if (argc == 1)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
if (optind == 0)
|
if (optind == 0)
|
||||||
optind = 1;
|
optind = 1;
|
||||||
|
|
||||||
|
if (argc == 1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
int short_index = find_short_index(&argv[optind]);
|
int short_index = find_short_index(&argv[optind]);
|
||||||
int long_index = find_long_index(&argv[optind]);
|
int long_index = find_long_index(&argv[optind]);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user