diff options
author | Eli Zaretskii <eliz@gnu.org> | 2022-04-18 21:04:57 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2022-04-18 21:04:57 +0300 |
commit | a45c1c45a29cbf9416bb03f77c99b383db43e7a0 (patch) | |
tree | f259753ae762ea7c86f1ed1b18d3452c1806c528 /src/w32console.c | |
parent | 850074636e73509b09c28e965c1af054a84f4069 (diff) | |
download | emacs-a45c1c45a29cbf9416bb03f77c99b383db43e7a0.tar.gz emacs-a45c1c45a29cbf9416bb03f77c99b383db43e7a0.tar.bz2 emacs-a45c1c45a29cbf9416bb03f77c99b383db43e7a0.zip |
Minor improvements in 'restart-emacs' on MS-Windows
* src/w32.c (w32_reexec_emacs): Explicitly request a new console
for the restarted Emacs -nw, and specify its dimensions. Specify
NULL instead of security attributes, per examples on the Internet.
* src/w32console.c (initialize_w32_display): Check errors in call
to GetConsoleCursorInfo.
Diffstat (limited to 'src/w32console.c')
-rw-r--r-- | src/w32console.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/w32console.c b/src/w32console.c index 12e1f397894..09749126e03 100644 --- a/src/w32console.c +++ b/src/w32console.c @@ -716,10 +716,10 @@ initialize_w32_display (struct terminal *term, int *width, int *height) if (cur_screen == INVALID_HANDLE_VALUE) { - printf ("CreateConsoleScreenBuffer failed in ResetTerm\n"); + printf ("CreateConsoleScreenBuffer failed in initialize_w32_display\n"); printf ("LastError = 0x%lx\n", GetLastError ()); fflush (stdout); - exit (0); + exit (1); } #else cur_screen = prev_screen; @@ -760,7 +760,13 @@ initialize_w32_display (struct terminal *term, int *width, int *height) } } - GetConsoleScreenBufferInfo (cur_screen, &info); + if (!GetConsoleScreenBufferInfo (cur_screen, &info)) + { + printf ("GetConsoleScreenBufferInfo failed in initialize_w32_display\n"); + printf ("LastError = 0x%lx\n", GetLastError ()); + fflush (stdout); + exit (1); + } char_attr_normal = info.wAttributes; |