From: Eli Zaretskii Date: Sat, 2 Feb 2019 15:12:13 +0000 (+0200) Subject: Prevent segfault in bootstrap-emacs on MinGW X-Git-Tag: emacs-27.0.90~3681 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c73d18ac423c5f96a3250e0a6dc983c17d9bd66c;p=emacs.git 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) --- diff --git a/src/emacs.c b/src/emacs.c index ff814a149b3..869b5307f23 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -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