From 3c46154212ea5a471c545127a40b7532daab32b4 Mon Sep 17 00:00:00 2001 From: Michael Beck Date: Tue, 13 May 2008 21:04:27 +0000 Subject: [PATCH] -BugFix: can not handle values with - in in, needed for instance for ia32-opt=k6-2 [r19604] --- ir/libcore/lc_opts.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ir/libcore/lc_opts.c b/ir/libcore/lc_opts.c index 4cb52df53..8d0868df4 100644 --- a/ir/libcore/lc_opts.c +++ b/ir/libcore/lc_opts.c @@ -726,7 +726,7 @@ int lc_opt_from_single_arg(const lc_opt_entry_t *root, int ret = 0; lc_opt_err_info_t err; - char *end, *buf; + char *end, *buf, *eqsign; if(n >= n_prefix && strncmp(opt_prefix, arg, n_prefix) == 0) { arg = arg + n_prefix; @@ -756,7 +756,10 @@ int lc_opt_from_single_arg(const lc_opt_entry_t *root, /* find the next delimiter (the -) and extract the string up to * there. */ - end = strchr(arg, OPT_DELIM); + end = strchr(arg, OPT_DELIM); + eqsign = strchr(arg, '='); + if (eqsign && eqsign < end) + end = NULL; while(end != NULL) { /* * Copy the part of the option into the buffer and add the @@ -772,7 +775,10 @@ int lc_opt_from_single_arg(const lc_opt_entry_t *root, /* Find the next option part delimiter. */ arg = end + 1; - end = strchr(arg, OPT_DELIM); + end = strchr(arg, OPT_DELIM); + eqsign = strchr(arg, '='); + if (eqsign && eqsign < end) + end = NULL; obstack_free(&obst, buf); } -- 2.20.1