From 626f41084b36a0fbd4dc3860b4f2a7b0bb284308 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 14 Nov 2017 08:42:16 -0600 Subject: [PATCH] apps/nshlib: Correct error introduced to conditional compilation --- nshlib/nsh.h | 7 ++++--- nshlib/nsh_mmcmds.c | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/nshlib/nsh.h b/nshlib/nsh.h index 3573f67a8..acbdeb8a4 100644 --- a/nshlib/nsh.h +++ b/nshlib/nsh.h @@ -684,12 +684,13 @@ # undef NSH_HAVE_TRIMDIR #endif -/* nsh_catfile used by cat, ifconfig, ifup/down, df, free, and mount */ +/* nsh_catfile used by cat, ifconfig, ifup/down, df, free, 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_MOUNT) || !defined(HAVE_MOUNT_LIST)) + !defined(CONFIG_NSH_DISABLE_FREE) && !defined(HAVE_MOUNT_LIST) # undef NSH_HAVE_CATFILE #endif diff --git a/nshlib/nsh_mmcmds.c b/nshlib/nsh_mmcmds.c index 75bdde8cf..235072c1d 100644 --- a/nshlib/nsh_mmcmds.c +++ b/nshlib/nsh_mmcmds.c @@ -42,6 +42,8 @@ #include "nsh.h" #include "nsh_console.h" +#if !defined(CONFIG_NSH_DISABLE_FREE) && defined(NSH_HAVE_CATFILE) + /**************************************************************************** * Public Functions ****************************************************************************/ @@ -50,9 +52,9 @@ * Name: cmd_free ****************************************************************************/ -#if !defined(CONFIG_NSH_DISABLE_FREE) && defined(NSH_HAVE_CATFILE) int cmd_free(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { return nsh_catfile(vtbl, argv[0], CONFIG_NSH_PROC_MOUNTPOINT "/meminfo"); } -#endif /* !CONFIG_NSH_DISABLE_FREE */ + +#endif /* !CONFIG_NSH_DISABLE_FREE && NSH_HAVE_CATFILE */