From 7f7b728231ffb40486924d16ce44c1ff29f3d981 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 2 Oct 2018 10:21:33 -0600 Subject: [PATCH] apps/nshlib/nsh_parse.c: Correct an error in conditional compilation found in build testing. --- nshlib/nsh_parse.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nshlib/nsh_parse.c b/nshlib/nsh_parse.c index c10c07564..8afd33116 100644 --- a/nshlib/nsh_parse.c +++ b/nshlib/nsh_parse.c @@ -217,7 +217,7 @@ static const char g_arg_separator[] = "`$"; #endif static const char g_redirect1[] = ">"; static const char g_redirect2[] = ">>"; -#ifdef CONFIG_NSH_VARS +#ifdef NSH_HAVE_VARS static const char g_exitstatus[] = "?"; static const char g_success[] = "0"; static const char g_failure[] = "1"; @@ -1034,11 +1034,11 @@ static FAR const char *nsh_envexpand(FAR struct nsh_vtbl_s *vtbl, { FAR const char *value; +#ifdef CONFIG_NSH_VARS /* Not a built-in? Return the value of the NSH variable with this * name. */ -#ifdef CONFIG_NSH_VARS value = nsh_getvar(vtbl, varname); if (value != NULL) { @@ -1046,11 +1046,11 @@ static FAR const char *nsh_envexpand(FAR struct nsh_vtbl_s *vtbl, } #endif - /* Not an NSH variable? Return the value of the NSH variable environment variable with this - * name. - */ - #ifndef CONFIG_DISABLE_ENVIRON + /* Not an NSH variable? Return the value of the NSH variable + * environment variable with this name. + */ + value = getenv(varname); if (value != NULL) {