From: Paul Eggert Date: Fri, 25 Jul 2025 02:44:48 +0000 (-0700) Subject: Streamline init_callproc a bit X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0cff403a1f79cfe333f8fa01194f92a61e179be4;p=emacs.git 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. (cherry picked from commit c403bc4d51e8466833ff728fddcca7ffe69740ee) --- 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; } }