+2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Make it possible to run ./temacs.
+
+ * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
+ syms_of_callproc does the same thing. Remove test for
+ "initialized", do it in the caller.
+ * emacs.c (main): Avoid calling set_initial_environment when dumping.
+
2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
* minibuf.c (Finternal_complete_buffer): Return `category' metadata.
void
set_initial_environment (void)
{
- register char **envp;
-#ifdef CANNOT_DUMP
- Vprocess_environment = Qnil;
-#else
- if (initialized)
-#endif
- {
- for (envp = environ; *envp; envp++)
- Vprocess_environment = Fcons (build_string (*envp),
- Vprocess_environment);
- /* Ideally, the `copy' shouldn't be necessary, but it seems it's frequent
- to use `delete' and friends on process-environment. */
- Vinitial_environment = Fcopy_sequence (Vprocess_environment);
- }
+ char **envp;
+ for (envp = environ; *envp; envp++)
+ Vprocess_environment = Fcons (build_string (*envp),
+ Vprocess_environment);
+ /* Ideally, the `copy' shouldn't be necessary, but it seems it's frequent
+ to use `delete' and friends on process-environment. */
+ Vinitial_environment = Fcopy_sequence (Vprocess_environment);
}
void
syms_of_callproc ();
/* egetenv is a pretty low-level facility, which may get called in
many circumstances; it seems flimsy to put off initializing it
- until calling init_callproc. */
- set_initial_environment ();
+ until calling init_callproc. Do not do it when dumping. */
+ if (initialized || ((strcmp (argv[argc-1], "dump") != 0
+ && strcmp (argv[argc-1], "bootstrap") != 0)))
+ set_initial_environment ();
+
/* AIX crashes are reported in system versions 3.2.3 and 3.2.4
if this is not done. Do it after set_global_environment so that we
don't pollute Vglobal_environment. */