diff options
Diffstat (limited to 'src')
| -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 ccc0dd269f4..0a90b0913be 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -940,20 +940,24 @@ load_pdump (int argc, char **argv) | |||
| 940 | sprintf (dump_file, "%s%c%s%s", | 940 | sprintf (dump_file, "%s%c%s%s", |
| 941 | path_exec, DIRECTORY_SEP, argv0_base, suffix); | 941 | path_exec, DIRECTORY_SEP, argv0_base, suffix); |
| 942 | #if !defined (NS_SELF_CONTAINED) | 942 | #if !defined (NS_SELF_CONTAINED) |
| 943 | /* Assume the Emacs binary lives in a sibling directory as set up by | 943 | if (!(emacs_executable && *emacs_executable)) |
| 944 | the default installation configuration. */ | 944 | { |
| 945 | const char *go_up = "../../../../bin/"; | 945 | /* If we didn't find the Emacs binary, assume that it lives in a |
| 946 | needed += (strip_suffix ? strlen (strip_suffix) : 0) | 946 | sibling directory as set up by the default installation |
| 947 | - strlen (suffix) + strlen (go_up); | 947 | configuration. */ |
| 948 | if (exec_bufsize < needed) | 948 | const char *go_up = "../../../../bin/"; |
| 949 | { | 949 | needed += (strip_suffix ? strlen (strip_suffix) : 0) |
| 950 | xfree (emacs_executable); | 950 | - strlen (suffix) + strlen (go_up); |
| 951 | emacs_executable = xpalloc (NULL, &exec_bufsize, needed - exec_bufsize, | 951 | if (exec_bufsize < needed) |
| 952 | -1, 1); | 952 | { |
| 953 | } | 953 | xfree (emacs_executable); |
| 954 | sprintf (emacs_executable, "%s%c%s%s%s", | 954 | emacs_executable = xpalloc (NULL, &exec_bufsize, |
| 955 | path_exec, DIRECTORY_SEP, go_up, argv0_base, | 955 | needed - exec_bufsize, -1, 1); |
| 956 | strip_suffix ? strip_suffix : ""); | 956 | } |
| 957 | sprintf (emacs_executable, "%s%c%s%s%s", | ||
| 958 | path_exec, DIRECTORY_SEP, go_up, argv0_base, | ||
| 959 | strip_suffix ? strip_suffix : ""); | ||
| 960 | } | ||
| 957 | #endif | 961 | #endif |
| 958 | result = pdumper_load (dump_file, emacs_executable); | 962 | result = pdumper_load (dump_file, emacs_executable); |
| 959 | 963 | ||