aboutsummaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-07 23:53:09 +0000
committerandersen <andersen@69ca8d6d-28ef-0310-b511-8ec308f3f277>2001-05-07 23:53:09 +0000
commitd7dc8a75bf01115f1657982c6b6d6753eef492a4 (patch)
treee67716c4d6591466a13d32eed9f5c24acb120b07 /shell
parent97650e243afda5455a4d68dc51f13dfe65f48a14 (diff)
downloadbusybox-w32-d7dc8a75bf01115f1657982c6b6d6753eef492a4.tar.gz
busybox-w32-d7dc8a75bf01115f1657982c6b6d6753eef492a4.tar.bz2
busybox-w32-d7dc8a75bf01115f1657982c6b6d6753eef492a4.zip
This patch from Evin Robertson <nitfol@my-deja.com> fixes export so it works.
This way leaks memory, but oh well. We will probably fix that when we get around to doing local variables. git-svn-id: svn://busybox.net/trunk/busybox@2570 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'shell')
-rw-r--r--shell/hush.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/shell/hush.c b/shell/hush.c
index e58ac44b3..a5f634b9a 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -469,7 +469,10 @@ static int builtin_export(struct child_prog *child)
469 if (child->argv[1] == NULL) { 469 if (child->argv[1] == NULL) {
470 return (builtin_env(child)); 470 return (builtin_env(child));
471 } 471 }
472 res = putenv(child->argv[1]); 472 /* FIXME -- I leak memory. This will be
473 * fixed up properly when we add local
474 * variable support -- I hope */
475 res = putenv(strdup(child->argv[1]));
473 if (res) 476 if (res)
474 fprintf(stderr, "export: %s\n", strerror(errno)); 477 fprintf(stderr, "export: %s\n", strerror(errno));
475 return (res); 478 return (res);