diff --git a/examples/nsh/nsh.h b/examples/nsh/nsh.h index 7626a4e3c02..b98cec49b83 100644 --- a/examples/nsh/nsh.h +++ b/examples/nsh/nsh.h @@ -184,7 +184,7 @@ /* Stubs used when working directory is not supported */ #if CONFIG_NFILE_DESCRIPTORS <= 0 || defined(CONFIG_DISABLE_ENVIRON) -# define nsh_getfullpath(v,p) (p) +# define nsh_getfullpath(v,p) ((char*)(p)) # define nsh_freefullpath(p) #endif diff --git a/examples/nsh/nsh_main.c b/examples/nsh/nsh_main.c index 20204d902c4..6acf48d530b 100644 --- a/examples/nsh/nsh_main.c +++ b/examples/nsh/nsh_main.c @@ -544,6 +544,7 @@ char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, char **saveptr) *saveptr = pend; +#ifndef CONFIG_DISABLE_ENVIRON /* Check for references to environment variables */ if (pbegin[0] == '$' && !quoted) @@ -563,7 +564,7 @@ char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, char **saveptr) } /* Not a built-in? Return the value of the environment variable with this name */ -#ifndef CONFIG_DISABLE_ENVIRON + else { char *value = getenv(pbegin+1); @@ -576,8 +577,8 @@ char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, char **saveptr) return (char*)""; } } -#endif } +#endif } /* Return the beginning of the token. */