1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Streamline init_callproc a bit

* src/callproc.c (init_callproc): Don’t bother testing for the
existence of ../src/ and NEWS if installation-directory is
non-nil, because in that case we will test for ../etc/NEWS anyway.
Simplify by using AUTO_STR.
This commit is contained in:
Paul Eggert 2025-07-24 19:44:48 -07:00
parent d7e8186080
commit c403bc4d51

View file

@ -2009,19 +2009,17 @@ init_callproc (void)
source directory. */
if (data_dir == 0)
{
Lisp_Object tem, srcdir;
Lisp_Object lispdir = Fcar (decode_env_path (0, PATH_DUMPLOADSEARCH, 0));
srcdir = Fexpand_file_name (build_string ("../src/"), lispdir);
tem = Fexpand_file_name (build_string ("NEWS"), Vdata_directory);
if (!NILP (Fequal (srcdir, Vinvocation_directory))
|| NILP (Ffile_exists_p (tem)) || !NILP (Vinstallation_directory))
if (!NILP (Vinstallation_directory)
|| !NILP (Fequal (Fexpand_file_name (AUTO_STR ("../src/"), lispdir),
Vinvocation_directory))
|| NILP (Ffile_exists_p (Fexpand_file_name (AUTO_STR ("NEWS"),
Vdata_directory))))
{
Lisp_Object newdir;
newdir = Fexpand_file_name (build_string ("../etc/"), lispdir);
tem = Fexpand_file_name (build_string ("NEWS"), newdir);
if (!NILP (Ffile_exists_p (tem)))
newdir = Fexpand_file_name (AUTO_STR ("../etc/"), lispdir);
if (!NILP (Ffile_exists_p (Fexpand_file_name (AUTO_STR ("NEWS"),
newdir))))
Vdata_directory = newdir;
}
}