emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114204: Fix corruption with multiple emacsclient -t


From: Paul Eggert
Subject: [Emacs-diffs] trunk r114204: Fix corruption with multiple emacsclient -t instances.
Date: Wed, 11 Sep 2013 08:24:09 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114204
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15222
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Wed 2013-09-11 01:24:05 -0700
message:
  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.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/term.c                     term.c-20091113204419-o5vbwnq5f7feedwu-220
  src/termchar.h                 termchar.h-20091113204419-o5vbwnq5f7feedwu-440
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-09-11 07:20:20 +0000
+++ b/src/ChangeLog     2013-09-11 08:24:05 +0000
@@ -1,3 +1,14 @@
+2013-09-11  Paul Eggert  <address@hidden>
+
+       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  <address@hidden>
 
        Fix last change.

=== modified file 'src/term.c'
--- a/src/term.c        2013-09-06 16:40:12 +0000
+++ b/src/term.c        2013-09-11 08:24:05 +0000
@@ -2917,12 +2917,8 @@
 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;
@@ -3013,13 +3009,9 @@
   /* 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)
@@ -3050,9 +3042,7 @@
                    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);

=== modified file 'src/termchar.h'
--- a/src/termchar.h    2013-08-27 03:52:21 +0000
+++ b/src/termchar.h    2013-09-11 08:24:05 +0000
@@ -30,9 +30,7 @@
   /* 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. */
 
@@ -78,7 +76,6 @@
      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];
@@ -86,7 +83,6 @@
   /* 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.  */
 


reply via email to

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