summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1993-08-11 20:04:39 +0000
committerRoland McGrath <roland@redhat.com>1993-08-11 20:04:39 +0000
commit2f8d1abe7c92d2211f675ec7d119705b5822a03f (patch)
treed23f13fce751b5b3fa7853a03f4a5d3873cae029 /main.c
parentd2654362c5e7f1debaa1ad70de350b86824cdebc (diff)
downloadgunmake-2f8d1abe7c92d2211f675ec7d119705b5822a03f.tar.gz
Formerly main.c.~93~
Diffstat (limited to 'main.c')
-rw-r--r--main.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/main.c b/main.c
index 412079a..31f4416 100644
--- a/main.c
+++ b/main.c
@@ -498,9 +498,15 @@ main (argc, argv, envp)
for (i = 0; envp[i] != 0; ++i)
{
register char *ep = envp[i];
- while (*ep++ != '=')
- ;
- (void) define_variable (envp[i], ep - envp[i] - 1, ep, o_env, 1);
+ while (*ep != '=')
+ ++ep;
+ define_variable (envp[i], ep - envp[i], ep + 1, o_env, 1)
+ /* Force exportation of every variable culled from the environment.
+ We used to rely on target_environment's v_default code to do this.
+ But that does not work for the case where an environment variable
+ is redefined in a makefile with `override'; it should then still
+ be exported, because it was originally in the environment. */
+ ->export = v_export;
}
/* Decode the switches. */