Changeset 659e9473 in mainline
- Timestamp:
- 2011-06-11T16:03:44Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6939edb
- Parents:
- f65b5fe9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/input.c
rf65b5fe9 r659e9473 56 56 static tinput_t *tinput; 57 57 58 static int run_command(char **, cliuser_t *); 59 58 60 /* Tokenizes input from console, sees if the first word is a built-in, if so 59 61 * invokes the built-in entry point (a[0]) passing all arguments in a[] to … … 62 64 { 63 65 char *cmd[WORD_MAX]; 64 int n = 0 , i = 0;66 int n = 0; 65 67 int rc = 0; 66 68 char *tmp; … … 76 78 } 77 79 78 /* We have rubbish */ 79 if (NULL == cmd[0]) { 80 rc = CL_ENOENT; 81 goto finit; 82 } 80 rc = run_command(cmd, usr); 83 81 84 /* Its a builtin command ? */85 if ((i = (is_builtin(cmd[0]))) > -1) {86 rc = run_builtin(i, cmd, usr);87 goto finit;88 /* Its a module ? */89 } else if ((i = (is_module(cmd[0]))) > -1) {90 rc = run_module(i, cmd);91 goto finit;92 }93 94 /* See what try_exec thinks of it */95 rc = try_exec(cmd[0], cmd);96 97 finit:98 82 if (NULL != usr->line) { 99 83 free(usr->line); … … 104 88 105 89 return rc; 90 } 91 92 int run_command(char **cmd, cliuser_t *usr) 93 { 94 int id = 0; 95 96 /* We have rubbish */ 97 if (NULL == cmd[0]) { 98 return CL_ENOENT; 99 } 100 101 /* Is it a builtin command ? */ 102 if ((id = (is_builtin(cmd[0]))) > -1) { 103 return run_builtin(id, cmd, usr); 104 } 105 106 /* Is it a module ? */ 107 if ((id = (is_module(cmd[0]))) > -1) { 108 return run_module(id, cmd); 109 } 110 111 /* See what try_exec thinks of it */ 112 return try_exec(cmd[0], cmd); 106 113 } 107 114
Note:
See TracChangeset
for help on using the changeset viewer.