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.
This commit is contained in:
Eric Andersen 2001-05-07 23:53:09 +00:00
parent 8cd16d8fd3
commit 45e92ba2ce
2 changed files with 8 additions and 2 deletions

5
hush.c
View File

@ -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);

View File

@ -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);