summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2014-01-10 11:06:28 +0100
committerAnton Babushkin <anton.babushkin@me.com>2014-01-10 11:06:28 +0100
commit43001e69766ccd50d011ffbf015c925d045ec483 (patch)
tree2fb03a03ce3fe8c03b6d49c10ec4b0a9d35a08b6 /apps
parent583fe5754d51e04d16ac9d24e779d2f1a9fd3e95 (diff)
downloadpx4-nuttx-43001e69766ccd50d011ffbf015c925d045ec483.tar.gz
px4-nuttx-43001e69766ccd50d011ffbf015c925d045ec483.tar.bz2
px4-nuttx-43001e69766ccd50d011ffbf015c925d045ec483.zip
nsh: don’t try to expand env variables in nsh_argument
Diffstat (limited to 'apps')
-rw-r--r--apps/nshlib/nsh_parse.c19
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
}