mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-14 13:26:16 +01:00
Treat optional arguments the same for long and short options
This was noticed in bug 642825 and the change was proposed by Kjell Ahlstedt.
This commit is contained in:
parent
c68c05a420
commit
ee9e38ef68
@ -1485,7 +1485,7 @@ parse_long_option (GOptionContext *context,
|
|||||||
value = arg + len + 1;
|
value = arg + len + 1;
|
||||||
else if (*idx < *argc - 1)
|
else if (*idx < *argc - 1)
|
||||||
{
|
{
|
||||||
if (!(group->entries[j].flags & G_OPTION_FLAG_OPTIONAL_ARG))
|
if (!OPTIONAL_ARG (&group->entries[j]))
|
||||||
{
|
{
|
||||||
value = (*argv)[*idx + 1];
|
value = (*argv)[*idx + 1];
|
||||||
add_pending_null (context, &((*argv)[*idx + 1]), NULL);
|
add_pending_null (context, &((*argv)[*idx + 1]), NULL);
|
||||||
@ -1510,8 +1510,7 @@ parse_long_option (GOptionContext *context,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (*idx >= *argc - 1 &&
|
else if (*idx >= *argc - 1 && OPTIONAL_ARG (&group->entries[j]))
|
||||||
group->entries[j].flags & G_OPTION_FLAG_OPTIONAL_ARG)
|
|
||||||
{
|
{
|
||||||
gboolean retval;
|
gboolean retval;
|
||||||
retval = parse_arg (context, group, &group->entries[j],
|
retval = parse_arg (context, group, &group->entries[j],
|
||||||
|
Loading…
Reference in New Issue
Block a user