aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli/cli-decode.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cli/cli-decode.c')
-rw-r--r--gdb/cli/cli-decode.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index d951ead..78b8901 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -1843,6 +1843,8 @@ lookup_cmd_composition (const char *text,
cur_list = cmdlist;
+ text = skip_spaces (text);
+
while (1)
{
/* Go through as many command lists as we need to,
@@ -1850,9 +1852,6 @@ lookup_cmd_composition (const char *text,
prev_cmd = *cmd;
- while (*text == ' ' || *text == '\t')
- (text)++;
-
/* Identify the name of the command. */
len = find_command_name_length (text);
@@ -1861,7 +1860,7 @@ lookup_cmd_composition (const char *text,
return 0;
/* TEXT is the start of the first command word to lookup (and
- it's length is len). We copy this into a local temporary. */
+ it's length is LEN). We copy this into a local temporary. */
command = (char *) alloca (len + 1);
memcpy (command, text, len);
@@ -1890,12 +1889,14 @@ lookup_cmd_composition (const char *text,
}
*prefix_cmd = prev_cmd;
}
- if ((*cmd)->prefixlist)
+
+ text += len;
+ text = skip_spaces (text);
+
+ if ((*cmd)->prefixlist && *text != '\0')
cur_list = *(*cmd)->prefixlist;
else
return 1;
-
- text += len;
}
}