gdb: Allow quoting around string options in the gdb::option framework
[deliverable/binutils-gdb.git] / gdb / cli / cli-option.c
index 07d552b7f5bbdaff7bc6f11a4e5c0ba999879ef6..eb8ef79d4f361fac573ea76e12d3a448cb25485f 100644 (file)
@@ -434,13 +434,12 @@ parse_option (gdb::array_view<const option_def_group> options_group,
          }
 
        const char *arg_start = *args;
-       *args = skip_to_space (*args);
-
+       std::string str = extract_string_maybe_quoted (args);
        if (*args == arg_start)
          error (_("-%s requires an argument"), match->name);
 
        option_value val;
-       val.string = savestring (arg_start, *args - arg_start);
+       val.string = xstrdup (str.c_str ());
        return option_def_and_value {*match, match_ctx, val};
       }
 
This page took 0.023618 seconds and 4 git commands to generate.