Prevent segfault in bootstrap-emacs on MinGW

* src/emacs.c (main) [WINDOWSNT]: Fix logic of determining by
argv[0] whether to use the static heap.  (Bug#34277)
This commit is contained in:
Eli Zaretskii 2019-02-02 17:12:13 +02:00
parent 2f55b971b4
commit c73d18ac42

View file

@ -914,7 +914,9 @@ main (int argc, char **argv)
happens. This relies on the static heap being needed only in
temacs and only if we are going to dump with unexec. */
bool use_dynamic_heap = false;
if (strstr (argv[0], "temacs") != NULL)
char *temacs_str = strstr (argv[0], "temacs");
if (temacs_str != NULL
&& (temacs_str == argv[0] || IS_DIRECTORY_SEP (temacs_str[-1])))
{
eassert (temacs);
/* Note that gflags are set at this point only if we have been