From 0cff403a1f79cfe333f8fa01194f92a61e179be4 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 24 Jul 2025 19:44:48 -0700 Subject: [PATCH] Streamline init_callproc a bit MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * 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. (cherry picked from commit c403bc4d51e8466833ff728fddcca7ffe69740ee) --- src/callproc.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/callproc.c b/src/callproc.c index c67b5eb74f9..ade56c30ea0 100644 --- a/src/callproc.c +++ b/src/callproc.c @@ -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; } } -- 2.39.5