Add a `restart-emacs' sanity check

* src/emacs.c (Fkill_emacs): Add a sanity check for argv.
This commit is contained in:
Lars Ingebrigtsen 2022-04-17 15:46:24 +02:00
parent ec025f22ef
commit 56d5a40794

View file

@ -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");
}