aboutsummaryrefslogtreecommitdiffstats
path: root/exec/exec.c
diff options
context:
space:
mode:
authorJens Schmidt2025-04-02 22:48:31 +0200
committerEli Zaretskii2025-04-13 11:33:30 +0300
commite82989757f42e95bf72a2a55de415a8162a55dc3 (patch)
treea403b48a17f89cc6a001eeeaad84a4e4e5c685bb /exec/exec.c
parent5665b446b7a5b2f6ff4d4e7ea9b2c91e0e733c92 (diff)
downloademacs-e82989757f42e95bf72a2a55de415a8162a55dc3.tar.gz
emacs-e82989757f42e95bf72a2a55de415a8162a55dc3.zip
Use a pristine copy of argv to restart Emacs
argv as left after main has proccessed the command-line can differ both in order and contents of the original command-line arguments, which can lead to surprising results when restarting emacs on the cooked argv through `kill-emacs'. Starting from that observation, consistenly use variables 'initial_cmdline' on Windows, 'initial_argc', 'initial_argv' on non-Windows, and 'initial_argv0' in all ports. * src/lisp.h: Declare 'initial_argv0', limit declaration of 'initial_argv' and 'initial_argc' to non-Windows ports. * src/emacs.c: Likewise, but for the definitions. (init_cmdargs): Move initialization of 'initial_argv' and 'initial_argc' ... (copy_args) [!WINDOWSNT]: ... to this new function ... (main): ... and call that in 'main', also initializing 'initial_argv0' before the command-line processing. * src/emacs.c (Fkill_emacs): * src/pgtkterm.c (pgtk_term_init): * src/sysdep.c (emacs_perror): * src/xterm.c (x_term_init): Use 'initial_argv0' where only that is required. (Bug#77389)
Diffstat (limited to 'exec/exec.c')
0 files changed, 0 insertions, 0 deletions