From: Stefan Kangas Date: Tue, 21 Jun 2022 04:30:25 +0000 (+0200) Subject: Merge from origin/emacs-28 X-Git-Tag: emacs-29.0.90~1447^2~1574 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c175984e2c909979da915ac46b0c92de67f4b249;p=emacs.git Merge from origin/emacs-28 2eb738f2b8 Support builds configured with a separate --bindir cf4c204df8 * doc/misc/eww.texi (Overview, Basics): Fix typos. --- c175984e2c909979da915ac46b0c92de67f4b249 diff --cc src/emacs.c index 236add1157d,0a90b0913be..5098acd7225 --- a/src/emacs.c +++ b/src/emacs.c @@@ -972,23 -937,27 +972,27 @@@ load_pdump (int argc, char **argv xfree (dump_file); dump_file = xpalloc (NULL, &bufsize, needed - bufsize, -1, 1); } - sprintf (dump_file, "%s%c%s%s", - path_exec, DIRECTORY_SEP, argv0_base, suffix); + sprintf (dump_file, "%s%c%s-%s%s", + path_exec, DIRECTORY_SEP, argv0_base, hexbuf, suffix); #if !defined (NS_SELF_CONTAINED) - /* Assume the Emacs binary lives in a sibling directory as set up by - the default installation configuration. */ - const char *go_up = "../../../../bin/"; - needed += (strip_suffix ? strlen (strip_suffix) : 0) - - strlen (suffix) + strlen (go_up); - if (exec_bufsize < needed) + if (!(emacs_executable && *emacs_executable)) { - xfree (emacs_executable); - emacs_executable = xpalloc (NULL, &exec_bufsize, needed - exec_bufsize, - -1, 1); + /* If we didn't find the Emacs binary, assume that it lives in a + sibling directory as set up by the default installation + configuration. */ + const char *go_up = "../../../../bin/"; + needed += (strip_suffix ? strlen (strip_suffix) : 0) + - strlen (suffix) + strlen (go_up); + if (exec_bufsize < needed) + { + xfree (emacs_executable); + emacs_executable = xpalloc (NULL, &exec_bufsize, + needed - exec_bufsize, -1, 1); + } + sprintf (emacs_executable, "%s%c%s%s%s", + path_exec, DIRECTORY_SEP, go_up, argv0_base, + strip_suffix ? strip_suffix : ""); } - sprintf (emacs_executable, "%s%c%s%s%s", - path_exec, DIRECTORY_SEP, go_up, argv0_base, - strip_suffix ? strip_suffix : ""); #endif result = pdumper_load (dump_file, emacs_executable);