Lines Matching full:length
92 static int msh_split(char *cmd, rt_size_t length, char *argv[FINSH_ARG_MAX]) in msh_split() argument
102 while (position < length) in msh_split()
105 while ((*ptr == ' ' || *ptr == '\t') && position < length) in msh_split()
122 if (position >= length) break; in msh_split()
131 while (*ptr != '"' && position < length) in msh_split()
142 if (position >= length) break; in msh_split()
151 while ((*ptr != ' ' && *ptr != '\t') && position < length) in msh_split()
155 if (position >= length) break; in msh_split()
192 int length, cmd_length = 0; in msh_exec_module() local
196 /* get the length of command0 */ in msh_exec_module()
200 /* get name length */ in msh_exec_module()
201 length = cmd_length + 32; in msh_exec_module()
204 pg_name = (char *) rt_malloc(length); in msh_exec_module()
220 rt_snprintf(pg_name, length - 1, "/bin/%.*s", cmd_length, cmd_line); in msh_exec_module()
235 rt_snprintf(pg_name, length - 1, "/bin/%.*s.mo", cmd_length, cmd_line); in msh_exec_module()
272 static int _msh_exec_cmd(char *cmd, rt_size_t length, int *retp) in _msh_exec_cmd() argument
283 while ((cmd[cmd0_size] != ' ' && cmd[cmd0_size] != '\t') && cmd0_size < length) in _msh_exec_cmd()
294 argc = msh_split(cmd, length, argv); in _msh_exec_cmd()
304 static int _msh_exec_lwp(char *cmd, rt_size_t length) in _msh_exec_lwp() argument
315 while ((cmd[cmd0_size] != ' ' && cmd[cmd0_size] != '\t') && cmd0_size < length) in _msh_exec_lwp()
322 argc = msh_split(cmd, length, argv); in _msh_exec_lwp()
341 int msh_exec(char *cmd, rt_size_t length) in msh_exec() argument
349 length--; in msh_exec()
352 if (length == 0) in msh_exec()
359 if (_msh_exec_cmd(cmd, length, &cmd_ret) == 0) in msh_exec()
365 if (msh_exec_script(cmd, length) == 0) in msh_exec()
372 if (msh_exec_module(cmd, length) == 0) in msh_exec()
379 if (_msh_exec_lwp(cmd, length) == 0) in msh_exec()
481 rt_size_t length, min_length; in msh_auto_complete_path() local
499 length = str_common(dirent->d_name, full_path); in msh_auto_complete_path()
501 if (length < min_length) in msh_auto_complete_path()
503 min_length = length; in msh_auto_complete_path()
525 length = index - path; in msh_auto_complete_path()
527 path[length + min_length] = '\0'; in msh_auto_complete_path()
538 int length, min_length; in msh_auto_complete() local
593 /* set initial length */ in msh_auto_complete()
597 length = str_common(name_ptr, cmd_name); in msh_auto_complete()
598 if (length < min_length) in msh_auto_complete()
599 min_length = length; in msh_auto_complete()