summaryrefslogtreecommitdiffhomepage
path: root/ir/libcore
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2013-04-23 10:01:29 +0200
committerMatthias Braun <matze@braunis.de>2013-04-23 14:58:47 +0200
commit0a80a1fbfa86aa33f2f3f088490a9a994eb8aeee (patch)
tree9662c7c7cb3f46aef6e323b07414bde3ef9fe33a /ir/libcore
parent415192712bb6d3f5352cc1fb16025b5133b8e1de (diff)
libcore: allow options with '-'
Usually '-' was used as delimiter for hierarchically nested option groups. We now try the completely remaining string as option if no subgroup can be found, so options like "soft-float" work now (as long as there is not subgroup named "soft")
Diffstat (limited to 'ir/libcore')
-rw-r--r--ir/libcore/lc_opts.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ir/libcore/lc_opts.c b/ir/libcore/lc_opts.c
index 260ac80..9fdd1bf 100644
--- a/ir/libcore/lc_opts.c
+++ b/ir/libcore/lc_opts.c
@@ -589,12 +589,13 @@ int lc_opt_from_single_arg(const lc_opt_entry_t *root, const char *arg)
char *buf = (char*)obstack_copy0(&obst, arg, end - arg);
/* Resolve the group inside the group */
- grp = lc_opt_find_grp(grp, buf);
- if (grp == NULL)
- return 0;
+ lc_opt_entry_t *new_grp = lc_opt_find_grp(grp, buf);
+ if (new_grp == NULL)
+ break;
+ grp = new_grp;
/* Find the next option part delimiter. */
- arg = end + 1;
+ arg = end + 1;
end = strchr(arg, OPT_DELIM);
eqsign = strchr(arg, '=');
if (eqsign && eqsign < end)