diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacs.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/emacs.c b/src/emacs.c index 92773996184..c5163db95a7 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -914,17 +914,23 @@ main (int argc, char **argv) | |||
| 914 | happens. This relies on the static heap being needed only in | 914 | happens. This relies on the static heap being needed only in |
| 915 | temacs and only if we are going to dump with unexec. */ | 915 | temacs and only if we are going to dump with unexec. */ |
| 916 | bool use_dynamic_heap = false; | 916 | bool use_dynamic_heap = false; |
| 917 | char *temacs_str = strstr (argv[0], "temacs"); | 917 | if (temacs) |
| 918 | if (temacs | ||
| 919 | && temacs_str != NULL | ||
| 920 | && (temacs_str == argv[0] || IS_DIRECTORY_SEP (temacs_str[-1]))) | ||
| 921 | { | 918 | { |
| 922 | /* Note that gflags are set at this point only if we have been | 919 | char *temacs_str = NULL, *p; |
| 923 | called with the --temacs=METHOD option. We assume here that | 920 | for (p = argv[0]; (p = strstr (p, "temacs")) != NULL; p++) |
| 924 | temacs is always called that way, otherwise the functions | 921 | temacs_str = p; |
| 925 | that rely on gflags, like will_dump_with_pdumper_p below, | 922 | if (temacs_str != NULL |
| 926 | will not do their job. */ | 923 | && (temacs_str == argv[0] || IS_DIRECTORY_SEP (temacs_str[-1]))) |
| 927 | use_dynamic_heap = will_dump_with_pdumper_p (); | 924 | { |
| 925 | /* Note that gflags are set at this point only if we have been | ||
| 926 | called with the --temacs=METHOD option. We assume here that | ||
| 927 | temacs is always called that way, otherwise the functions | ||
| 928 | that rely on gflags, like will_dump_with_pdumper_p below, | ||
| 929 | will not do their job. */ | ||
| 930 | use_dynamic_heap = will_dump_with_pdumper_p (); | ||
| 931 | } | ||
| 932 | else | ||
| 933 | use_dynamic_heap = true; | ||
| 928 | } | 934 | } |
| 929 | else | 935 | else |
| 930 | use_dynamic_heap = true; | 936 | use_dynamic_heap = true; |