goption: Reject group options specified with three dashes

Commandline option parsing would recognize group options specified
with three dashes (i.e. ---foo 42).  This behaviour was limited to group
options.
This commit is contained in:
Nathan Miller
2018-06-13 10:29:42 -05:00
parent 2fe4fa6cd0
commit 0b09890bff
2 changed files with 45 additions and 1 deletions

View File

@@ -2028,7 +2028,7 @@ g_option_context_parse (GOptionContext *context,
/* Now look for --<group>-<option> */
dash = strchr (arg, '-');
if (dash)
if (dash && arg < dash)
{
/* Try the groups */
list = context->groups;