nshlib: Remove the unnecessary temp path buffer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2025-01-19 09:58:40 +08:00 committed by GUIDINGLI
parent 903fbe41e9
commit 131d50ae9d

View file

@ -2191,7 +2191,6 @@ int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
bool recursive = false;
bool force = false;
FAR char *fullpath;
char buf[PATH_MAX];
struct stat stat;
int ret = ERROR;
int c;
@ -2234,8 +2233,7 @@ int cmd_rm(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
{
if (recursive)
{
strlcpy(buf, fullpath, PATH_MAX);
ret = unlink_recursive(buf, &stat);
ret = unlink_recursive(fullpath, &stat);
}
else
{