diff options
| author | Paul Eggert | 2013-09-11 01:24:05 -0700 |
|---|---|---|
| committer | Paul Eggert | 2013-09-11 01:24:05 -0700 |
| commit | 73f82c7e8eb6a009248f4ea6360b2182d06f55e2 (patch) | |
| tree | 72a9eddac1e2c9c1db8a62b97031f72d53b66140 /src/term.c | |
| parent | 53482f41157f37a7f6afb7f19be8fc63b015f6ed (diff) | |
| download | emacs-73f82c7e8eb6a009248f4ea6360b2182d06f55e2.tar.gz emacs-73f82c7e8eb6a009248f4ea6360b2182d06f55e2.zip | |
Fix corruption with multiple emacsclient -t instances.
This bug was introduced by my 2013-08-26 patch, which incorrectly
assumed that the terminfo implementation doesn't use termcap buffers.
* term.c (init_tty) [TERMINFO]: Remove optimization, as
these buffers apparently are used after all.
* termchar.h (TERMCAP_BUFFER_SIZE) [TERMINFO]: Define here too.
(struct tty_display_info): Define members termcap_term_buffer and
termcap_strings_buffer even if TERMINFO.
Fixes: debbugs:15222
Diffstat (limited to 'src/term.c')
| -rw-r--r-- | src/term.c | 10 |
1 files changed, 0 insertions, 10 deletions
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) | |||
| 2917 | struct terminal * | 2917 | struct terminal * |
| 2918 | init_tty (const char *name, const char *terminal_type, bool must_succeed) | 2918 | init_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); |