Make it possible to run ./temacs.
authorDan Nicolaescu <dann@ics.uci.edu>
Tue, 31 May 2011 05:12:19 +0000 (22:12 -0700)
committerDan Nicolaescu <dann@ics.uci.edu>
Tue, 31 May 2011 05:12:19 +0000 (22:12 -0700)
* 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
src/callproc.c
src/emacs.c

index 813e590..536ba29 100644 (file)
@@ -1,3 +1,12 @@
+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.
index 67d0b6a..7bb2ac0 100644 (file)
@@ -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
index cf74963..3a7c5c0 100644 (file)
@@ -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.  */