+
+ old_anm = array_needs_making;
+ tvar = bind_variable ("PWD", dirname);
+ /* This is an efficiency hack. If PWD is exported, we will need to
+ remake the exported environment every time we change directories.
+ If there is no other reason to make the exported environment, just
+ update PWD in place and mark the exported environment as no longer
+ needing a remake. */
+ if (old_anm == 0 && array_needs_making && exported_p (tvar))
+ {
+ pwdvar = xmalloc (strlen (dirname) + 5); /* 5 = "PWD" + '=' + '\0' */
+ strcpy (pwdvar, "PWD=");
+ strcpy (pwdvar + 4, dirname);
+ add_or_supercede_exported_var (pwdvar, 0);
+ array_needs_making = 0;
+ }