diff options
author | Stefan Kangas <stefan@marxist.se> | 2022-06-21 06:30:25 +0200 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2022-06-21 06:30:25 +0200 |
commit | c175984e2c909979da915ac46b0c92de67f4b249 (patch) | |
tree | da1edbf9fa41a6ccd2a54e9fe1cfffd6ddf3c211 /src/emacs.c | |
parent | 1d681a57005c837a58c9b3a365bc59f7293c4df5 (diff) | |
parent | 2eb738f2b8a3948b590ac7a6640f317a5cb12918 (diff) | |
download | emacs-c175984e2c909979da915ac46b0c92de67f4b249.tar.gz |
Merge from origin/emacs-28
2eb738f2b8 Support builds configured with a separate --bindir
cf4c204df8 * doc/misc/eww.texi (Overview, Basics): Fix typos.
Diffstat (limited to 'src/emacs.c')
-rw-r--r-- | src/emacs.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/emacs.c b/src/emacs.c index 236add1157d..5098acd7225 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -975,20 +975,24 @@ load_pdump (int argc, char **argv) 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) - { - 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 : ""); + if (!(emacs_executable && *emacs_executable)) + { + /* 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 : ""); + } #endif result = pdumper_load (dump_file, emacs_executable); |