summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-12 00:32:54 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-12 00:32:54 +0000
commita9adec2e3a4eb05291c4484bf8918a60cb13885d (patch)
treec1b9e5aee9755f957c6efe6e81d9719bb83c4581
parente710939a9f27ee399911160e8422f3b8aab211dd (diff)
do not quitenv() too early, or "s" goes away due to it's temporary nature;
fix found in freebsd ports tree.. original by ejc@bazzle.com
-rw-r--r--bin/ksh/main.c4
-rw-r--r--bin/pdksh/main.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/bin/ksh/main.c b/bin/ksh/main.c
index 5bbc327a651..d161fb9b3d0 100644
--- a/bin/ksh/main.c
+++ b/bin/ksh/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.8 1997/09/01 18:30:09 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.9 1997/09/12 00:32:53 deraadt Exp $ */
/*
* startup, main loop, enviroments and error handling
@@ -487,9 +487,9 @@ include(name, argc, argv, intr_ok)
s->u.shf = shf;
s->file = str_save(name, ATEMP);
i = shell(s, FALSE);
- quitenv();
source = sold;
shf_close(s->u.shf);
+ quitenv();
if (old_argv) {
e->loc->argv = old_argv;
e->loc->argc = old_argc;
diff --git a/bin/pdksh/main.c b/bin/pdksh/main.c
index 5bbc327a651..d161fb9b3d0 100644
--- a/bin/pdksh/main.c
+++ b/bin/pdksh/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.8 1997/09/01 18:30:09 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.9 1997/09/12 00:32:53 deraadt Exp $ */
/*
* startup, main loop, enviroments and error handling
@@ -487,9 +487,9 @@ include(name, argc, argv, intr_ok)
s->u.shf = shf;
s->file = str_save(name, ATEMP);
i = shell(s, FALSE);
- quitenv();
source = sold;
shf_close(s->u.shf);
+ quitenv();
if (old_argv) {
e->loc->argv = old_argv;
e->loc->argc = old_argc;