init_lread fix for bug#12302
authorGlenn Morris <rgm@gnu.org>
Thu, 30 Aug 2012 00:47:33 +0000 (20:47 -0400)
committerGlenn Morris <rgm@gnu.org>
Thu, 30 Aug 2012 00:47:33 +0000 (20:47 -0400)
* src/lread.c (init_lread): For out-of-tree builds, only add the
source directory's site-lisp dir to the load-path if it exists,
consistent with in-tree builds.

src/ChangeLog
src/lread.c

index b5751d8..fef02d8 100644 (file)
@@ -1,3 +1,9 @@
+2012-08-30  Glenn Morris  <rgm@gnu.org>
+
+       * lread.c (init_lread): For out-of-tree builds, only add the
+       source directory's site-lisp dir to the load-path if it exists,
+       consistent with in-tree builds.  (Bug#12302)
+
 2012-08-28  Jan Djärv  <jan.h.d@swipnet.se>
 
        * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
index b0413c9..aa3e0cf 100644 (file)
@@ -4253,9 +4253,12 @@ init_lread (void)
                         {
                           tem = Fexpand_file_name (build_string ("site-lisp"),
                                                    Vsource_directory);
-
-                          if (NILP (Fmember (tem, Vload_path)))
-                            Vload_path = Fcons (tem, Vload_path);
+                          tem1 = Ffile_exists_p (tem);
+                          if (!NILP (tem1))
+                            {
+                              if (NILP (Fmember (tem, Vload_path)))
+                                Vload_path = Fcons (tem, Vload_path);
+                            }
                         }
                     }
                 } /* Vinstallation_directory != Vsource_directory */