nshlib: merge nsh_getdirpath() to nsh_fsutils.c

Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
ligd
2022-02-10 15:36:42 +08:00
committed by Xiang Xiao
parent ec15dc0344
commit d6a187efed
4 changed files with 59 additions and 67 deletions

View File

@@ -490,7 +490,8 @@
*/
#if defined(CONFIG_NSH_DISABLE_LS) && defined(CONFIG_NSH_DISABLE_CP) && \
defined(CONFIG_NSH_DISABLE_PS) && !defined(CONFIG_NSH_PLATFORM_MOTD)
defined(CONFIG_NSH_DISABLE_PS) && !defined(CONFIG_NSH_PLATFORM_MOTD) && \
defined(CONFIG_DISABLE_ENVIRON)
# undef NSH_HAVE_IOBUFFER
#endif
@@ -1388,6 +1389,25 @@ void nsh_trimdir(FAR char *dirpath);
FAR char *nsh_trimspaces(FAR char *str);
#endif
/****************************************************************************
* Name: nsh_getdirpath
*
* Description:
* Combine dirpath with a file/path, this will genarated a new string,
* which need free outside.
*
* Input Parameters:
* dirpath - the dirpath
* path - the file/path
*
* Returned value:
* The new string pointer, need free in caller.
*
****************************************************************************/
FAR char *nsh_getdirpath(FAR struct nsh_vtbl_s *vtbl,
FAR const char *dirpath, FAR const char *path);
/****************************************************************************
* Name: nsh_getvar, nsh_setvar, and nsh_setvar
*