This is an automated email from the ASF dual-hosted git repository.
xiaoxiang781216 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
The following commit(s) were added to refs/heads/master by this push:
new 88d3c39b5 nshlib: Do not remove nsh_catfile() when cat is enabled.
88d3c39b5 is described below
commit 88d3c39b5eebacc193f70cda9dac6cf421668d9b
Author: Marco Casaroli <[email protected]>
AuthorDate: Fri Nov 13 08:36:12 2026 +0100
nshlib: Do not remove nsh_catfile() when cat is enabled.
nsh.h undefines NSH_HAVE_CATFILE when cat, ifconfig, ifup/down, df,
free and env are all enabled, and irqinfo and the mount list are not.
The test of the six commands is inverted: cat always uses
nsh_catfile(). With procfs, no network, no IRQ monitor and
CONFIG_FS_PROCFS_EXCLUDE_MOUNT=y, the build fails:
nsh_command.c: error: 'cmd_mount' undeclared here
More commands use nsh_catfile() than the list names (dmesg, fdinfo,
route, ...). Remove the test, so nsh_catfile() is always built. With
--gc-sections, the linker removes it when no command uses it.
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <[email protected]>
---
nshlib/nsh.h | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/nshlib/nsh.h b/nshlib/nsh.h
index 00cdcadab..078b059d5 100644
--- a/nshlib/nsh.h
+++ b/nshlib/nsh.h
@@ -518,17 +518,6 @@
# define CONFIG_NSH_DISABLE_EXPORT 1
#endif
-/* nsh_catfile used by cat, ifconfig, ifup/down, df, free, env, irqinfo, and
- * mount (with no arguments).
- */
-
-#if !defined(CONFIG_NSH_DISABLE_CAT) && !defined(CONFIG_NSH_DISABLE_IFCONFIG)
&& \
- !defined(CONFIG_NSH_DISABLE_IFUPDOWN) && !defined(CONFIG_NSH_DISABLE_DF)
&& \
- !defined(CONFIG_NSH_DISABLE_FREE) && !defined(CONFIG_NSH_DISABLE_ENV) && \
- !defined(HAVE_IRQINFO) && !defined(HAVE_MOUNT_LIST)
-# undef NSH_HAVE_CATFILE
-#endif
-
/* nsh_readfile used by ps command */
#if defined(CONFIG_NSH_DISABLE_PS)