emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master c73d18a: Prevent segfault in bootstrap-emacs on Min


From: Eli Zaretskii
Subject: [Emacs-diffs] master c73d18a: Prevent segfault in bootstrap-emacs on MinGW
Date: Sat, 2 Feb 2019 10:14:04 -0500 (EST)

branch: master
commit c73d18ac423c5f96a3250e0a6dc983c17d9bd66c
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    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)
---
 src/emacs.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/emacs.c b/src/emacs.c
index ff814a1..869b530 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]