From 119fced20f7995efed9decfc7ce02987912c5943 Mon Sep 17 00:00:00 2001 From: Kaspar Schleiser Date: Wed, 3 Nov 2010 13:40:26 +0100 Subject: [PATCH] * shell fixes --- sys/shell/shell.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/shell/shell.c b/sys/shell/shell.c index 50dce540f1..f306bec5a5 100644 --- a/sys/shell/shell.c +++ b/sys/shell/shell.c @@ -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) { char* saveptr; - char* command = strtok_r(line, " ", &saveptr); + char* linedup = strdup(line); + char* command = strtok_r(linedup, " ", &saveptr); void (*handler)(char*) = NULL; @@ -72,10 +73,11 @@ static void handle_input_line(shell_t *shell, char* line) { if (handler) { handler(line); } else { - printf("shell: command \"%s\" not found.\n", command); + printf("shell: command not found.\n"); } } + free(linedup); free(line); }