diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-06-06 16:07:28 +0400 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-06-06 16:07:28 +0400 |
commit | 1a92376f00778fa576390d0a0f3dc0bdd9c289dc (patch) | |
tree | f02276d7dfb21f6a572be54819966c43a3253e5f /shell | |
parent | e90e741b1eaf4a22b4c13de73a477f8eb45254b1 (diff) |
Patch from vodz to only setenv PATH when PATH changes, which is much
smarter than my quick fix.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/ash.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/shell/ash.c b/shell/ash.c index d834cc02a..80da35b59 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -3841,6 +3841,8 @@ changepath(const char *newval) builtinloc = bltin; /* zap builtins */ clearcmdentry(firstchange); builtinloc = bltin; + /* Ensure that getenv("PATH") stays current */ + setenv("PATH", newval, 1); } @@ -4111,8 +4113,6 @@ path_change(const char *newval, int *bltin) } if (builtinloc >= 0 && *bltin < 0) firstchange = 0; - /* Ensure that getenv("PATH") stays current */ - setenv("PATH", newval, 1); return firstchange; } /* @@ -12442,7 +12442,7 @@ findvar(struct var **vpp, const char *name) /* * Copyright (c) 1999 Herbert Xu <herbert@debian.org> * This file contains code for the times builtin. - * $Id: ash.c,v 1.51 2002/06/04 20:10:15 sandman Exp $ + * $Id: ash.c,v 1.52 2002/06/06 12:07:28 andersen Exp $ */ static int timescmd (int argc, char **argv) { |