From cbba3ecd36f0f861e4e810fbd5415c9759080cdc Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 13 Jun 2019 00:06:52 +0100 Subject: Make check_for_argument skip whitespace after arg itself Basically every caller of check_for_argument needs to skip space after the argument. This patch makes check_for_argument do it itself. Suggested by Philippe Waroquiers. gdb/ChangeLog: 2019-06-13 Pedro Alves * ax-gdb.c (agent_command_1): Remove skip_spaces call. * breakpoint.c (watch_maybe_just_location): Remove skip_spaces call. * cli/cli-cmds.c (apropos_command): Remove skip_spaces call. * cli/cli-utils.c (extract_info_print_args): Remove skip_spaces calls. (check_for_argument): Skip spaces after argument. --- gdb/breakpoint.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'gdb/breakpoint.c') diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 80f343e..dce8a0f 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -10896,10 +10896,7 @@ watch_maybe_just_location (const char *arg, int accessflag, int from_tty) if (arg && (check_for_argument (&arg, "-location", sizeof ("-location") - 1) || check_for_argument (&arg, "-l", sizeof ("-l") - 1))) - { - arg = skip_spaces (arg); - just_location = 1; - } + just_location = 1; watch_command_1 (arg, accessflag, from_tty, just_location, 0); } -- cgit v1.1