From 43001e69766ccd50d011ffbf015c925d045ec483 Mon Sep 17 00:00:00 2001 From: Anton Babushkin Date: Fri, 10 Jan 2014 11:06:28 +0100 Subject: nsh: don’t try to expand env variables in nsh_argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/nshlib/nsh_parse.c | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) (limited to 'apps') diff --git a/apps/nshlib/nsh_parse.c b/apps/nshlib/nsh_parse.c index 6fd7c04cc..5151cb369 100644 --- a/apps/nshlib/nsh_parse.c +++ b/apps/nshlib/nsh_parse.c @@ -995,12 +995,10 @@ char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, char **saveptr) *saveptr = pend; #ifndef CONFIG_DISABLE_ENVIRON - /* Check for references to environment variables */ + /* Check for built-in variables, environment variables already expanded before */ if (pbegin[0] == '$' && !quoted) { - /* Check for built-in variables */ - if (strcmp(pbegin, g_exitstatus) == 0) { if (vtbl->np.np_fail) @@ -1012,21 +1010,6 @@ char *nsh_argument(FAR struct nsh_vtbl_s *vtbl, char **saveptr) return (char*)g_success; } } - - /* Not a built-in? Return the value of the environment variable with this name */ - - else - { - char *value = getenv(pbegin+1); - if (value) - { - return value; - } - else - { - return (char*)""; - } - } } #endif } -- cgit v1.2.3