+2013-09-11 Paul Eggert <eggert@cs.ucla.edu>
+
+ Fix corruption with multiple emacsclient -t instances (Bug#15222).
+ 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.
+
2013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
Fix last change.
struct terminal *
init_tty (const char *name, const char *terminal_type, bool must_succeed)
{
-#ifdef TERMINFO
- char **address = 0;
-#else
char *area;
char **address = &area;
-#endif
int status;
struct tty_display_info *tty = NULL;
struct terminal *terminal = NULL;
/* On some systems, tgetent tries to access the controlling
terminal. */
block_tty_out_signal ();
-#ifdef TERMINFO
- status = tgetent (0, terminal_type);
-#else
status = tgetent (tty->termcap_term_buffer, terminal_type);
if (tty->termcap_term_buffer[TERMCAP_BUFFER_SIZE - 1])
emacs_abort ();
-#endif
unblock_tty_out_signal ();
if (status < 0)
terminal_type);
}
-#ifndef TERMINFO
area = tty->termcap_strings_buffer;
-#endif
tty->TS_ins_line = tgetstr ("al", address);
tty->TS_ins_multi_lines = tgetstr ("AL", address);
tty->TS_bell = tgetstr ("bl", address);
/* There is nothing else here at the moment... */
};
-#ifndef TERMINFO
enum { TERMCAP_BUFFER_SIZE = 4096 };
-#endif
/* Parameters that are shared between frames on the same tty device. */
mouse-face. */
Mouse_HLInfo mouse_highlight;
-#ifndef TERMINFO
/* Buffer used internally by termcap (see tgetent in the Termcap
manual). Only init_tty should use this. */
char termcap_term_buffer[TERMCAP_BUFFER_SIZE];
/* Buffer storing terminal description strings (see tgetstr in the
Termcap manual). Only init_tty should use this. */
char termcap_strings_buffer[TERMCAP_BUFFER_SIZE];
-#endif
/* Strings, numbers and flags taken from the termcap entry. */