aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog11
-rw-r--r--src/term.c10
-rw-r--r--src/termchar.h4
3 files changed, 11 insertions, 14 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index f51e6a147bf..21cb47eeeaa 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,14 @@
12013-09-11 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix corruption with multiple emacsclient -t instances (Bug#15222).
4 This bug was introduced by my 2013-08-26 patch, which incorrectly
5 assumed that the terminfo implementation doesn't use termcap buffers.
6 * term.c (init_tty) [TERMINFO]: Remove optimization, as
7 these buffers apparently are used after all.
8 * termchar.h (TERMCAP_BUFFER_SIZE) [TERMINFO]: Define here too.
9 (struct tty_display_info): Define members termcap_term_buffer and
10 termcap_strings_buffer even if TERMINFO.
11
12013-09-11 Dmitry Antipov <dmantipov@yandex.ru> 122013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
2 13
3 Fix last change. 14 Fix last change.
diff --git a/src/term.c b/src/term.c
index 0270c1eefa6..fd5ea5a1b8d 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2917,12 +2917,8 @@ dissociate_if_controlling_tty (int fd)
2917struct terminal * 2917struct terminal *
2918init_tty (const char *name, const char *terminal_type, bool must_succeed) 2918init_tty (const char *name, const char *terminal_type, bool must_succeed)
2919{ 2919{
2920#ifdef TERMINFO
2921 char **address = 0;
2922#else
2923 char *area; 2920 char *area;
2924 char **address = &area; 2921 char **address = &area;
2925#endif
2926 int status; 2922 int status;
2927 struct tty_display_info *tty = NULL; 2923 struct tty_display_info *tty = NULL;
2928 struct terminal *terminal = NULL; 2924 struct terminal *terminal = NULL;
@@ -3013,13 +3009,9 @@ init_tty (const char *name, const char *terminal_type, bool must_succeed)
3013 /* On some systems, tgetent tries to access the controlling 3009 /* On some systems, tgetent tries to access the controlling
3014 terminal. */ 3010 terminal. */
3015 block_tty_out_signal (); 3011 block_tty_out_signal ();
3016#ifdef TERMINFO
3017 status = tgetent (0, terminal_type);
3018#else
3019 status = tgetent (tty->termcap_term_buffer, terminal_type); 3012 status = tgetent (tty->termcap_term_buffer, terminal_type);
3020 if (tty->termcap_term_buffer[TERMCAP_BUFFER_SIZE - 1]) 3013 if (tty->termcap_term_buffer[TERMCAP_BUFFER_SIZE - 1])
3021 emacs_abort (); 3014 emacs_abort ();
3022#endif
3023 unblock_tty_out_signal (); 3015 unblock_tty_out_signal ();
3024 3016
3025 if (status < 0) 3017 if (status < 0)
@@ -3050,9 +3042,7 @@ use the Bourne shell command `TERM=... export TERM' (C-shell:\n\
3050 terminal_type); 3042 terminal_type);
3051 } 3043 }
3052 3044
3053#ifndef TERMINFO
3054 area = tty->termcap_strings_buffer; 3045 area = tty->termcap_strings_buffer;
3055#endif
3056 tty->TS_ins_line = tgetstr ("al", address); 3046 tty->TS_ins_line = tgetstr ("al", address);
3057 tty->TS_ins_multi_lines = tgetstr ("AL", address); 3047 tty->TS_ins_multi_lines = tgetstr ("AL", address);
3058 tty->TS_bell = tgetstr ("bl", address); 3048 tty->TS_bell = tgetstr ("bl", address);
diff --git a/src/termchar.h b/src/termchar.h
index 687f7fbd119..11cea34df23 100644
--- a/src/termchar.h
+++ b/src/termchar.h
@@ -30,9 +30,7 @@ struct tty_output
30 /* There is nothing else here at the moment... */ 30 /* There is nothing else here at the moment... */
31}; 31};
32 32
33#ifndef TERMINFO
34enum { TERMCAP_BUFFER_SIZE = 4096 }; 33enum { TERMCAP_BUFFER_SIZE = 4096 };
35#endif
36 34
37/* Parameters that are shared between frames on the same tty device. */ 35/* Parameters that are shared between frames on the same tty device. */
38 36
@@ -78,7 +76,6 @@ struct tty_display_info
78 mouse-face. */ 76 mouse-face. */
79 Mouse_HLInfo mouse_highlight; 77 Mouse_HLInfo mouse_highlight;
80 78
81#ifndef TERMINFO
82 /* Buffer used internally by termcap (see tgetent in the Termcap 79 /* Buffer used internally by termcap (see tgetent in the Termcap
83 manual). Only init_tty should use this. */ 80 manual). Only init_tty should use this. */
84 char termcap_term_buffer[TERMCAP_BUFFER_SIZE]; 81 char termcap_term_buffer[TERMCAP_BUFFER_SIZE];
@@ -86,7 +83,6 @@ struct tty_display_info
86 /* Buffer storing terminal description strings (see tgetstr in the 83 /* Buffer storing terminal description strings (see tgetstr in the
87 Termcap manual). Only init_tty should use this. */ 84 Termcap manual). Only init_tty should use this. */
88 char termcap_strings_buffer[TERMCAP_BUFFER_SIZE]; 85 char termcap_strings_buffer[TERMCAP_BUFFER_SIZE];
89#endif
90 86
91 /* Strings, numbers and flags taken from the termcap entry. */ 87 /* Strings, numbers and flags taken from the termcap entry. */
92 88