]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix the MSDOS build when running under CWSDPMI
authorEli Zaretskii <eliz@gnu.org>
Mon, 15 Apr 2019 15:05:52 +0000 (18:05 +0300)
committerEli Zaretskii <eliz@gnu.org>
Mon, 15 Apr 2019 15:05:52 +0000 (18:05 +0300)
* src/msdos.c (the_only_tty_output): Define.
* src/msdos.h (the_only_tty_output): Declare.
* src/frame.c (make_terminal_frame) [MSDOS]:
* src/dispnew.c (init_display) [MSDOS]: Set up
f->output_data.tty pointer using the_only_tty_output, before
dereferencing the pointer.  This prevents crashes with DPMI
servers that provide NULL pointer protection.

src/dispnew.c
src/frame.c
src/msdos.c
src/msdos.h

index 03fac54e05bced6ffcb599a49a411adae11d7d6c..15a58cc2f57f0a2cca239b4877c9e49aa0e53bfe 100644 (file)
@@ -6117,6 +6117,7 @@ init_display (void)
 
     t->reference_count++;
 #ifdef MSDOS
+    f->output_data.tty = &the_only_tty_output;
     f->output_data.tty->display_info = &the_only_display_info;
 #else
     if (f->output_method == output_termcap)
index 4ed140d7d084f1947bae67548a22c3a00ce7e3e6..08925308f9c0cd6daec36ee01106e0f379215b9b 100644 (file)
@@ -1117,6 +1117,7 @@ make_terminal_frame (struct terminal *terminal)
   f->terminal = terminal;
   f->terminal->reference_count++;
 #ifdef MSDOS
+  f->output_data.tty = &the_only_tty_output;
   f->output_data.tty->display_info = &the_only_display_info;
   if (!inhibit_window_system
       && (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame))
index 3645dc8bb30732310ea59dd347553823229f2272..4367da4714d124c1303e27e2e18880417045fde3 100644 (file)
@@ -420,6 +420,9 @@ static unsigned short outside_cursor;
 /* The only display since MS-DOS does not support multiple ones.  */
 struct tty_display_info the_only_display_info;
 
+/* The only tty_output, since MS-DOS supports only 1 display.  */
+struct tty_output the_only_tty_output;
+
 /* Support for DOS/V (allows Japanese characters to be displayed on
    standard, non-Japanese, ATs).  Only supported for DJGPP v2 and later.  */
 
index ff756f8f63463067bf70fd2cf0639eb6520aeb1a..0d15df7a331b61f4411b2d85c3ae77972ec47001 100644 (file)
@@ -93,6 +93,7 @@ typedef int XRectangle;
 typedef struct tty_display_info Display_Info;
 
 extern struct tty_display_info the_only_display_info;
+extern struct tty_output the_only_tty_output;
 
 #define FRAME_X_DISPLAY(f) ((Display *) 0)
 #define FRAME_FONT(f) ((f)->output_data.tty->font)