diff options
Diffstat (limited to 'bin/sh/var.c')
-rw-r--r-- | bin/sh/var.c | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/bin/sh/var.c b/bin/sh/var.c index 44d2028..e14027f 100644 --- a/bin/sh/var.c +++ b/bin/sh/var.c @@ -161,7 +161,7 @@ INIT { /* * This routine initializes the builtin variables. It is called when the - * shell is initialized and again when a shell procedure is spawned. + * shell is initialized. */ void @@ -542,47 +542,6 @@ environment(void) } -/* - * Called when a shell procedure is invoked to clear out nonexported - * variables. It is also necessary to reallocate variables of with - * VSTACK set since these are currently allocated on the stack. - */ - -MKINIT void shprocvar(void); - -#ifdef mkinit -SHELLPROC { - shprocvar(); -} -#endif - -void -shprocvar(void) -{ - struct var **vpp; - struct var *vp, **prev; - - for (vpp = vartab ; vpp < vartab + VTABSIZE ; vpp++) { - for (prev = vpp ; (vp = *prev) != NULL ; ) { - if ((vp->flags & VEXPORT) == 0) { - *prev = vp->next; - if ((vp->flags & VTEXTFIXED) == 0) - ckfree(vp->text); - if ((vp->flags & VSTRFIXED) == 0) - ckfree(vp); - } else { - if (vp->flags & VSTACK) { - vp->text = savestr(vp->text); - vp->flags &=~ VSTACK; - } - prev = &vp->next; - } - } - } - initvar(); -} - - static int var_compare(const void *a, const void *b) { |