emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-26 70ec392: Fix the MSDOS build when running under C


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-26 70ec392: Fix the MSDOS build when running under CWSDPMI
Date: Mon, 15 Apr 2019 11:06:48 -0400 (EDT)

branch: emacs-26
commit 70ec3928666353b69efae1bdc831d704fa505e72
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix the MSDOS build when running under CWSDPMI
    
    * 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 | 1 +
 src/frame.c   | 1 +
 src/msdos.c   | 3 +++
 src/msdos.h   | 1 +
 4 files changed, 6 insertions(+)

diff --git a/src/dispnew.c b/src/dispnew.c
index 03fac54..15a58cc 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -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)
diff --git a/src/frame.c b/src/frame.c
index 4ed140d..0892530 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -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))
diff --git a/src/msdos.c b/src/msdos.c
index 3645dc8..4367da4 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -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.  */
 
diff --git a/src/msdos.h b/src/msdos.h
index ff756f8..0d15df7 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]