diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-04-26 23:40:09 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-04-26 23:40:09 +0000 |
commit | 1c31501b1bacd5d3a2a156dfd6833fe174fff9d1 (patch) | |
tree | 9c1339c37bea59728464b9372e80d37554185f9c | |
parent | 416340642df18d92600998566ccb1bec25b10d4b (diff) | |
download | busybox-w32-1c31501b1bacd5d3a2a156dfd6833fe174fff9d1.tar.gz busybox-w32-1c31501b1bacd5d3a2a156dfd6833fe174fff9d1.tar.bz2 busybox-w32-1c31501b1bacd5d3a2a156dfd6833fe174fff9d1.zip |
Ensure that getenv("PATH") stays current, since otherwise cmdedit
(which calls getenv("PATH")) would not operate upon the current
PATH settings, which was really quite iritating.
-Erik
-rw-r--r-- | shell/ash.c | 4 | ||||
-rw-r--r-- | shell/msh.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/shell/ash.c b/shell/ash.c index e721c4ee5..99d5e7d74 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -4111,6 +4111,8 @@ path_change(const char *newval, int *bltin) | |||
4111 | } | 4111 | } |
4112 | if (builtinloc >= 0 && *bltin < 0) | 4112 | if (builtinloc >= 0 && *bltin < 0) |
4113 | firstchange = 0; | 4113 | firstchange = 0; |
4114 | /* Ensure that getenv("PATH") stays current */ | ||
4115 | setenv("PATH", newval, 1); | ||
4114 | return firstchange; | 4116 | return firstchange; |
4115 | } | 4117 | } |
4116 | /* | 4118 | /* |
@@ -12433,7 +12435,7 @@ findvar(struct var **vpp, const char *name) | |||
12433 | /* | 12435 | /* |
12434 | * Copyright (c) 1999 Herbert Xu <herbert@debian.org> | 12436 | * Copyright (c) 1999 Herbert Xu <herbert@debian.org> |
12435 | * This file contains code for the times builtin. | 12437 | * This file contains code for the times builtin. |
12436 | * $Id: ash.c,v 1.48 2002/04/24 23:12:10 andersen Exp $ | 12438 | * $Id: ash.c,v 1.49 2002/04/26 23:39:48 andersen Exp $ |
12437 | */ | 12439 | */ |
12438 | static int timescmd (int argc, char **argv) | 12440 | static int timescmd (int argc, char **argv) |
12439 | { | 12441 | { |
diff --git a/shell/msh.c b/shell/msh.c index a2f98c837..1485ccb6f 100644 --- a/shell/msh.c +++ b/shell/msh.c | |||
@@ -842,6 +842,8 @@ extern int msh_main(int argc, char **argv) | |||
842 | #endif | 842 | #endif |
843 | } | 843 | } |
844 | onecommand(); | 844 | onecommand(); |
845 | /* Ensure that getenv("PATH") stays current */ | ||
846 | setenv("PATH", path->value, 1); | ||
845 | } | 847 | } |
846 | } | 848 | } |
847 | 849 | ||