fix wrong sign in infinite loop commit
This commit is contained in:
parent
156d8a2070
commit
88ac663421
1 changed files with 3 additions and 2 deletions
|
|
@ -177,7 +177,7 @@ static int do_exec(msh_lexer *lexer, char *cmd, char **args, int *n,
|
||||||
/* loop through all the path entries and check if the file exists in them.
|
/* loop through all the path entries and check if the file exists in them.
|
||||||
*/
|
*/
|
||||||
i = 0, *n = 0, j = 0;
|
i = 0, *n = 0, j = 0;
|
||||||
while (j >= lexer->path_count) {
|
while (j <= lexer->path_count) {
|
||||||
full_path[*n] = lexer->path[j];
|
full_path[*n] = lexer->path[j];
|
||||||
*n += 1;
|
*n += 1;
|
||||||
if (lexer->path[j] == '\0') {
|
if (lexer->path[j] == '\0') {
|
||||||
|
|
@ -186,7 +186,8 @@ static int do_exec(msh_lexer *lexer, char *cmd, char **args, int *n,
|
||||||
full_path[i + *n] = cmd[i];
|
full_path[i + *n] = cmd[i];
|
||||||
}
|
}
|
||||||
*n += i;
|
*n += i;
|
||||||
full_path[*n++] = '\0';
|
full_path[*n] = '\0';
|
||||||
|
*n += 1;
|
||||||
|
|
||||||
if (msh_path_exists(full_path)) {
|
if (msh_path_exists(full_path)) {
|
||||||
msh_execute(full_path, args);
|
msh_execute(full_path, args);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue