mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-11 11:56:16 +01:00
Merge branch 'parsing' into 'master'
goption.c: Simplfy parse_short_option() See merge request GNOME/glib!1999
This commit is contained in:
commit
33734480d3
@ -1543,23 +1543,14 @@ parse_short_option (GOptionContext *context,
|
||||
|
||||
if (idx < *argc - 1)
|
||||
{
|
||||
if (!OPTIONAL_ARG (&group->entries[j]))
|
||||
if (OPTIONAL_ARG (&group->entries[j]) && ((*argv)[idx + 1][0] == '-'))
|
||||
value = NULL;
|
||||
else
|
||||
{
|
||||
value = (*argv)[idx + 1];
|
||||
add_pending_null (context, &((*argv)[idx + 1]), NULL);
|
||||
*new_idx = idx + 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((*argv)[idx + 1][0] == '-')
|
||||
value = NULL;
|
||||
else
|
||||
{
|
||||
value = (*argv)[idx + 1];
|
||||
add_pending_null (context, &((*argv)[idx + 1]), NULL);
|
||||
*new_idx = idx + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (idx >= *argc - 1 && OPTIONAL_ARG (&group->entries[j]))
|
||||
value = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user