> compile NEMU
ysyx_22040000 李心杨 Linux calcite 6.1.69 #1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 20 16:00:29 UTC 2023 x86_64 GNU/Linux 22:28:54 up 3 days 21:29, 2 users, load average: 0.64, 1.01, 0.91
This commit is contained in:
parent
32f5ddfed0
commit
3fd601183a
1 changed files with 8 additions and 1 deletions
|
@ -200,13 +200,20 @@ wrong_usage:
|
||||||
static int cmd_info(char *args) {
|
static int cmd_info(char *args) {
|
||||||
char *arg = strtok(NULL, " ");
|
char *arg = strtok(NULL, " ");
|
||||||
int i;
|
int i;
|
||||||
|
if (arg == NULL) {
|
||||||
|
goto wrong_usage;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
for (i = 0; i < NR_CMD; i++) {
|
for (i = 0; i < NR_CMD; i++) {
|
||||||
if (strcmp(arg, cmd_info_table[i].name) == 0) {
|
if (strcmp(arg, cmd_info_table[i].name) == 0) {
|
||||||
cmd_info_table[i].handler(args);
|
cmd_info_table[i].handler(args);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wrong_usage:
|
||||||
|
printf("Invalid argument for command info: %s\n", args);
|
||||||
|
printf("Usage: info [r | w]\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue