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:
chao an
2024-12-10 21:06:08 +08:00
committed by Xiang Xiao
parent d7ed69200f
commit e861ea8b53
6 changed files with 43 additions and 34 deletions

View File

@@ -150,6 +150,12 @@ struct nsh_vtbl_s
/* Ctrl tty or not */
bool isctty;
/* Current working directory */
#ifdef CONFIG_DISABLE_ENVIRON
char cwd[PATH_MAX];
#endif
};
/* This structure describes a console front-end that is based on stdin and