From: Lars Ingebrigtsen Date: Sun, 17 Apr 2022 13:46:24 +0000 (+0200) Subject: Add a `restart-emacs' sanity check X-Git-Tag: emacs-29.0.90~1931^2~457 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=56d5a4079423aa22d2203a342439df7359eb1c18;p=emacs.git Add a `restart-emacs' sanity check * src/emacs.c (Fkill_emacs): Add a sanity check for argv. --- diff --git a/src/emacs.c b/src/emacs.c index 173e8e8923d..a16e702ab7b 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2807,6 +2807,10 @@ killed. */ if (!NILP (restart)) { + /* This is very unlikely, but it's possible to execute a binary + (on some systems) with no argv. */ + if (initial_argc < 1) + error ("No command line arguments known; unable to re-execute Emacs"); if (execvp (*initial_argv, initial_argv) < 1) error ("Unable to re-execute Emacs"); }