aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2019-04-15 18:05:52 +0300
committerEli Zaretskii2019-04-15 18:05:52 +0300
commit70ec3928666353b69efae1bdc831d704fa505e72 (patch)
treeb84519a00dbfbe4943fd19d0f6d5aff58d0ddd19
parent7a608fc6f3ded3e615e7accb29f16bfd290d80a1 (diff)
downloademacs-70ec3928666353b69efae1bdc831d704fa505e72.tar.gz
emacs-70ec3928666353b69efae1bdc831d704fa505e72.zip
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.
-rw-r--r--src/dispnew.c1
-rw-r--r--src/frame.c1
-rw-r--r--src/msdos.c3
-rw-r--r--src/msdos.h1
4 files changed, 6 insertions, 0 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index 03fac54e05b..15a58cc2f57 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -6117,6 +6117,7 @@ init_display (void)
6117 6117
6118 t->reference_count++; 6118 t->reference_count++;
6119#ifdef MSDOS 6119#ifdef MSDOS
6120 f->output_data.tty = &the_only_tty_output;
6120 f->output_data.tty->display_info = &the_only_display_info; 6121 f->output_data.tty->display_info = &the_only_display_info;
6121#else 6122#else
6122 if (f->output_method == output_termcap) 6123 if (f->output_method == output_termcap)
diff --git a/src/frame.c b/src/frame.c
index 4ed140d7d08..08925308f9c 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1117,6 +1117,7 @@ make_terminal_frame (struct terminal *terminal)
1117 f->terminal = terminal; 1117 f->terminal = terminal;
1118 f->terminal->reference_count++; 1118 f->terminal->reference_count++;
1119#ifdef MSDOS 1119#ifdef MSDOS
1120 f->output_data.tty = &the_only_tty_output;
1120 f->output_data.tty->display_info = &the_only_display_info; 1121 f->output_data.tty->display_info = &the_only_display_info;
1121 if (!inhibit_window_system 1122 if (!inhibit_window_system
1122 && (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame)) 1123 && (!FRAMEP (selected_frame) || !FRAME_LIVE_P (XFRAME (selected_frame))
diff --git a/src/msdos.c b/src/msdos.c
index 3645dc8bb30..4367da4714d 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -420,6 +420,9 @@ static unsigned short outside_cursor;
420/* The only display since MS-DOS does not support multiple ones. */ 420/* The only display since MS-DOS does not support multiple ones. */
421struct tty_display_info the_only_display_info; 421struct tty_display_info the_only_display_info;
422 422
423/* The only tty_output, since MS-DOS supports only 1 display. */
424struct tty_output the_only_tty_output;
425
423/* Support for DOS/V (allows Japanese characters to be displayed on 426/* Support for DOS/V (allows Japanese characters to be displayed on
424 standard, non-Japanese, ATs). Only supported for DJGPP v2 and later. */ 427 standard, non-Japanese, ATs). Only supported for DJGPP v2 and later. */
425 428
diff --git a/src/msdos.h b/src/msdos.h
index ff756f8f634..0d15df7a331 100644
--- a/src/msdos.h
+++ b/src/msdos.h
@@ -93,6 +93,7 @@ typedef int XRectangle;
93typedef struct tty_display_info Display_Info; 93typedef struct tty_display_info Display_Info;
94 94
95extern struct tty_display_info the_only_display_info; 95extern struct tty_display_info the_only_display_info;
96extern struct tty_output the_only_tty_output;
96 97
97#define FRAME_X_DISPLAY(f) ((Display *) 0) 98#define FRAME_X_DISPLAY(f) ((Display *) 0)
98#define FRAME_FONT(f) ((f)->output_data.tty->font) 99#define FRAME_FONT(f) ((f)->output_data.tty->font)