From: Eli Zaretskii Date: Sat, 17 Apr 2021 15:10:52 +0000 (+0300) Subject: * src/emacs.c (load_pdump): Fix unconditional references to strip_suffix. X-Git-Tag: emacs-28.0.90~2727^2~13 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b8d386083f8f0a0f7ec16f43055cc9f557f6a7f3;p=emacs.git * src/emacs.c (load_pdump): Fix unconditional references to strip_suffix. --- 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)