mirror of
https://github.com/HEYAHONG/nuttx-apps.git
synced 2025-10-19 19:44:31 +08:00
nshlib/[cd|ls|pwd]: add support for local CWD(Current working directory)
This PR will still allow basic shell operations such as cd/ls/pwd to be used even when the environment is disabled. Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
@@ -442,6 +442,13 @@ FAR struct console_stdio_s *nsh_newconsole(bool isctty)
|
||||
/* Initialize the input stream */
|
||||
|
||||
INFD(pstate) = STDIN_FILENO;
|
||||
|
||||
/* Initialize current working directory */
|
||||
|
||||
#ifdef CONFIG_DISABLE_ENVIRON
|
||||
strlcpy(pstate->cn_vtbl.cwd, CONFIG_LIBC_HOMEDIR,
|
||||
sizeof(pstate->cn_vtbl.cwd));
|
||||
#endif
|
||||
}
|
||||
|
||||
return pstate;
|
||||
|
Reference in New Issue
Block a user