mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
* shell fixes
This commit is contained in:
parent
aa174e886e
commit
119fced20f
@ -63,7 +63,8 @@ static void(*find_handler(const shell_command_t *command_list, char *command))(c
|
|||||||
|
|
||||||
static void handle_input_line(shell_t *shell, char* line) {
|
static void handle_input_line(shell_t *shell, char* line) {
|
||||||
char* saveptr;
|
char* saveptr;
|
||||||
char* command = strtok_r(line, " ", &saveptr);
|
char* linedup = strdup(line);
|
||||||
|
char* command = strtok_r(linedup, " ", &saveptr);
|
||||||
|
|
||||||
void (*handler)(char*) = NULL;
|
void (*handler)(char*) = NULL;
|
||||||
|
|
||||||
@ -72,10 +73,11 @@ static void handle_input_line(shell_t *shell, char* line) {
|
|||||||
if (handler) {
|
if (handler) {
|
||||||
handler(line);
|
handler(line);
|
||||||
} else {
|
} else {
|
||||||
printf("shell: command \"%s\" not found.\n", command);
|
printf("shell: command not found.\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(linedup);
|
||||||
free(line);
|
free(line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user