(init_callproc): Never set Vdata_directory based on
authorRichard M. Stallman <rms@gnu.org>
Thu, 12 May 1994 06:35:19 +0000 (06:35 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 12 May 1994 06:35:19 +0000 (06:35 +0000)
the executable's location.  But maybe set it from source dir.

src/callproc.c

index 606d5e0..b3f88e5 100644 (file)
@@ -851,10 +851,34 @@ init_callproc ()
            {
              tem = Fexpand_file_name (build_string ("etc"),
                                       Vinstallation_directory);
-             Vdoc_directory = Vdata_directory = Ffile_name_as_directory (tem);
+             Vdoc_directory = Ffile_name_as_directory (tem);
            }
        }
     }
+
+  /* Look for the files that should be in etc.  We don't use
+     Vinstallation_directory, because these files are never installed
+     in /bin near the executable, and they are never in the build
+     directory when that's different from the source directory.
+
+     Instead, if these files are not in the nominal place, we try the
+     source directory.  */
+  if (data_dir == 0)
+    {
+      Lisp_Object tem, tem1, newdir;
+
+      tem = Fexpand_file_name (build_string ("GNU"), Vdata_directory);
+      tem1 = Ffile_exists_p (tem);
+      if (NILP (tem1))
+       {
+         newdir = Fexpand_file_name (build_string ("../etc/"),
+                                     build_string (PATH_DUMPLOADSEARCH));
+         tem = Fexpand_file_name (build_string ("GNU"), newdir);
+         tem1 = Ffile_exists_p (tem);
+         if (!NILP (tem1))
+           Vdata_directory = newdir;
+       }
+    }
 #endif
 
   tempdir = Fdirectory_file_name (Vexec_directory);