Changeset 6939edb in mainline
- Timestamp:
- 2011-06-11T19:40:17Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 28ee877e
- Parents:
- 659e9473
- Location:
- uspace/app/bdsh
- Files:
-
- 2 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/Makefile
r659e9473 r6939edb 58 58 util.c \ 59 59 exec.c \ 60 scli.c 60 scli.c \ 61 tok.c 61 62 62 63 include $(USPACE_PREFIX)/Makefile.common -
uspace/app/bdsh/input.c
r659e9473 r6939edb 50 50 #include "errors.h" 51 51 #include "exec.h" 52 #include "tok.h" 52 53 53 54 extern volatile unsigned int cli_quit; … … 56 57 static tinput_t *tinput; 57 58 59 /* Private helpers */ 58 60 static int run_command(char **, cliuser_t *); 59 61 … … 64 66 { 65 67 char *cmd[WORD_MAX]; 66 int n = 0;67 68 int rc = 0; 68 char *tmp;69 tokenizer_t tok; 69 70 70 71 if (NULL == usr->line) 71 72 return CL_EFAIL; 72 73 73 tmp = str_dup(usr->line); 74 75 cmd[n] = strtok(tmp, " "); 76 while (cmd[n] && n < WORD_MAX) { 77 cmd[++n] = strtok(NULL, " "); 74 rc = tok_init(&tok, usr->line, cmd, WORD_MAX); 75 if (rc != EOK) { 76 goto finit; 78 77 } 79 78 79 rc = tok_tokenize(&tok); 80 if (rc != EOK) { 81 goto finit; 82 } 83 80 84 rc = run_command(cmd, usr); 81 85 86 finit: 82 87 if (NULL != usr->line) { 83 88 free(usr->line); 84 89 usr->line = (char *) NULL; 85 90 } 86 if (NULL != tmp) 87 free(tmp); 91 tok_fini(&tok); 88 92 89 93 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.