Accept partial match of monitor commands.

This commit is contained in:
Gareth McMullin 2012-02-12 12:02:50 +13:00
parent 4282244fb4
commit 35a9e10f49
1 changed files with 4 additions and 1 deletions

View File

@ -75,7 +75,10 @@ int command_process(char *cmd)
/* Look for match and call handler */ /* Look for match and call handler */
for(c = cmd_list; c->cmd; c++) { for(c = cmd_list; c->cmd; c++) {
if(!strcmp(argv[0], c->cmd)) { /* Accept a partial match as GDB does.
* So 'mon ver' will match 'monitor version'
*/
if(!strncmp(argv[0], c->cmd, strlen(argv[0]))) {
c->handler(argc, argv); c->handler(argc, argv);
return 0; return 0;
} }