mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-20 04:26:04 +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:
@@ -1578,12 +1578,7 @@ int cmd_ls(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
|
||||
}
|
||||
else if (optind >= argc)
|
||||
{
|
||||
#ifndef CONFIG_DISABLE_ENVIRON
|
||||
relpath = nsh_getcwd();
|
||||
#else
|
||||
nsh_error(vtbl, g_fmtargrequired, argv[0]);
|
||||
return ERROR;
|
||||
#endif
|
||||
relpath = nsh_getcwd(vtbl);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user