+2004-12-01 Paul D. Smith <psmith@gnu.org>
+
+ * main.c (main): Change char* env_shell to struct variable shell_var.
+ * variable.c (target_environment): Use new shell_var.
+
2004-11-30 Paul D. Smith <psmith@gnu.org>
* configure.in: The old way we avoided creating build.sh from
/* Remember the original value of the SHELL variable, from the environment. */
-const char *env_shell = 0;
+struct variable shell_var;
\f
/* The usage output. We write it this way to make life easier for the
if (strncmp (envp[i], "SHELL=", 6) == 0)
{
v->export = v_noexport;
- env_shell = xstrdup (ep + 1);
+ shell_var.name = "SHELL";
+ shell_var.value = xstrdup (ep + 1);
}
}
}
extern int warn_undefined_variables_flag, posix_pedantic, not_parallel;
extern int clock_skew_detected, rebuilding_makefiles;
-extern const char *env_shell;
-
/* can we run commands via 'sh -c xxx' or must we use batch files? */
extern int batch_mode_shell;
struct variable makelevel_key;
char **result_0;
char **result;
- struct variable ev;
-
- /* Set up a fake variable struct for the original SHELL value. */
- ev.name = "SHELL";
- ev.value = env_shell;
if (file == 0)
set_list = current_variable_set_list;
break;
case v_noexport:
- if (!streq (v->name, "SHELL"))
- continue;
/* If this is the SHELL variable and it's not exported, then
add the value from our original environment. */
- v = &ev;
- break;
+ if (streq (v->name, "SHELL"))
+ {
+ extern struct variable shell_var;
+ v = &shell_var;
+ break;
+ }
+ continue;
case v_ifset:
if (v->origin == o_default)