Skip to content
Snippets Groups Projects
Commit 126304cd authored by Kaspar Schleiser's avatar Kaspar Schleiser
Browse files

* shell: strtok workaround

parent dc094d44
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,8 @@ static void(*find_handler(const shell_command_t *command_list, char *command))(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) { 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;
...@@ -75,7 +76,8 @@ static void handle_input_line(shell_t *shell, char* line) { ...@@ -75,7 +76,8 @@ static void handle_input_line(shell_t *shell, char* line) {
puts("shell: command not found."); puts("shell: command not found.");
} }
} }
free(linedup);
} }
int readline(shell_t *shell, char* buf, int size) { int readline(shell_t *shell, char* buf, int size) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment