diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-01-10 11:06:28 +0100 |
---|---|---|
committer | Anton Babushkin <anton.babushkin@me.com> | 2014-01-10 11:06:28 +0100 |
commit | 43001e69766ccd50d011ffbf015c925d045ec483 (patch) | |
tree | 2fb03a03ce3fe8c03b6d49c10ec4b0a9d35a08b6 | |
parent | 583fe5754d51e04d16ac9d24e779d2f1a9fd3e95 (diff) | |
download | nuttx-43001e69766ccd50d011ffbf015c925d045ec483.tar.gz nuttx-43001e69766ccd50d011ffbf015c925d045ec483.tar.bz2 nuttx-43001e69766ccd50d011ffbf015c925d045ec483.zip |
nsh: don’t try to expand env variables in nsh_argument
-rw-r--r-- | apps/nshlib/nsh_parse.c | 19 |
1 files changed, 1 insertions, 18 deletions
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 } |