From d7dc8a75bf01115f1657982c6b6d6753eef492a4 Mon Sep 17 00:00:00 2001 From: andersen Date: Mon, 7 May 2001 23:53:09 +0000 Subject: This patch from Evin Robertson 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 --- shell/hush.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'shell') 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) if (child->argv[1] == NULL) { return (builtin_env(child)); } - res = putenv(child->argv[1]); + /* FIXME -- I leak memory. This will be + * fixed up properly when we add local + * variable support -- I hope */ + res = putenv(strdup(child->argv[1])); if (res) fprintf(stderr, "export: %s\n", strerror(errno)); return (res); -- cgit v1.2.3-55-g6feb