From b8d386083f8f0a0f7ec16f43055cc9f557f6a7f3 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 17 Apr 2021 18:10:52 +0300 Subject: [PATCH] * src/emacs.c (load_pdump): Fix unconditional references to strip_suffix. --- src/emacs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/emacs.c b/src/emacs.c index 2fc93631c9e..896e129c75f 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -917,7 +917,8 @@ load_pdump (int argc, char **argv) /* Assume the Emacs binary lives in a sibling directory as set up by the default installation configuration. */ const char *go_up = "../../../../bin/"; - needed += strlen (strip_suffix) - strlen (suffix) + strlen (go_up); + needed += (strip_suffix ? strlen (strip_suffix) : 0) + - strlen (suffix) + strlen (go_up); if (exec_bufsize < needed) { xfree (emacs_executable); @@ -925,7 +926,8 @@ load_pdump (int argc, char **argv) -1, 1); } sprintf (emacs_executable, "%s%c%s%s%s", - path_exec, DIRECTORY_SEP, go_up, argv0_base, strip_suffix); + path_exec, DIRECTORY_SEP, go_up, argv0_base, + strip_suffix ? strip_suffix : ""); result = pdumper_load (dump_file, emacs_executable); if (result == PDUMPER_LOAD_FILE_NOT_FOUND) -- 2.39.2