From 738db17859465a4adaaf1d43bbb1d1eed307e712 Mon Sep 17 00:00:00 2001 From: Dan Nicolaescu Date: Mon, 30 May 2011 22:12:19 -0700 Subject: [PATCH] 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. --- src/ChangeLog | 9 +++++++++ src/callproc.c | 21 +++++++-------------- src/emacs.c | 7 +++++-- 3 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 813e590681d..536ba29cb2c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,12 @@ +2011-05-31 Dan Nicolaescu + + 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 * minibuf.c (Finternal_complete_buffer): Return `category' metadata. diff --git a/src/callproc.c b/src/callproc.c index 67d0b6aede3..7bb2ac05933 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -1603,20 +1603,13 @@ init_callproc (void) 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 diff --git a/src/emacs.c b/src/emacs.c index cf74963a816..3a7c5c0bf3d 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1423,8 +1423,11 @@ main (int argc, char **argv) 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. */ -- 2.11.4.GIT