From 169bcab3311e712a08e2d5656acd8e110823dad6 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sun, 9 Apr 2017 11:54:59 -0600 Subject: [PATCH] NSH: Eliminate warning about unused variable. --- nshlib/nsh_envcmds.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nshlib/nsh_envcmds.c b/nshlib/nsh_envcmds.c index b323d9538..23e2eb95e 100644 --- a/nshlib/nsh_envcmds.c +++ b/nshlib/nsh_envcmds.c @@ -316,7 +316,9 @@ int cmd_set(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { FAR char *value; int ret = OK; +#ifndef CONFIG_DISABLE_ENVIRON int ndx = 1; +#endif #ifndef CONFIG_NSH_DISABLESCRIPT FAR char *popt; const char opts[] = NSH_NP_SET_OPTIONS; @@ -362,17 +364,20 @@ int cmd_set(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) } } +#ifndef CONFIG_DISABLE_ENVIRON if (ret == OK) { ndx = 2; } +#endif } } } -# ifndef CONFIG_DISABLE_ENVIRON + +#ifndef CONFIG_DISABLE_ENVIRON if (ret == OK && (argc == 3 || argc == 4)) -# endif #endif +#endif /* CONFIG_NSH_DISABLESCRIPT */ #ifndef CONFIG_DISABLE_ENVIRON { /* Trim whitespace from the value */