bugfix: 解决shell在exec的时候传递的argv不正确的bug (#437)

This commit is contained in:
LoGin
2023-11-12 17:53:36 +08:00
committed by GitHub
parent 709498cac1
commit 4a2d7191a3
2 changed files with 4 additions and 5 deletions

View File

@ -522,9 +522,9 @@ int shell_cmd_exec(int argc, char **argv)
// printf("before execv, path=%s, argc=%d\n", file_path, argc);
char **real_argv;
if (argc > 2)
if (argc > 1)
{
real_argv = &argv[2];
real_argv = &argv[1];
}
execv(file_path, real_argv);
// printf("after execv, path=%s, argc=%d\n", file_path, argc);