emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/src/term.c


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/src/term.c
Date: Tue, 19 Aug 2003 19:47:22 -0400

Index: emacs/src/term.c
diff -c emacs/src/term.c:1.146 emacs/src/term.c:1.147
*** emacs/src/term.c:1.146      Sat May 24 18:04:48 2003
--- emacs/src/term.c    Tue Aug 19 19:47:22 2003
***************
*** 2159,2165 ****
  {
    char *area;
    char **address = &area;
!   char buffer[2044];
    register char *p;
    int status;
    struct frame *sf = XFRAME (selected_frame);
--- 2159,2166 ----
  {
    char *area;
    char **address = &area;
!   char *buffer = NULL;
!   const int buffer_size = 4096;
    register char *p;
    int status;
    struct frame *sf = XFRAME (selected_frame);
***************
*** 2171,2179 ****
  
    area = (char *) xmalloc (2044);
  
-   if (area == 0)
-     abort ();
- 
    FrameRows = FRAME_LINES (sf);
    FrameCols = FRAME_COLS (sf);
    specified_window = FRAME_LINES (sf);
--- 2172,2177 ----
***************
*** 2202,2207 ****
--- 2200,2206 ----
  
    Wcm_clear ();
  
+   buffer = (char *) xmalloc (buffer_size);
    status = tgetent (buffer, terminal_type);
    if (status < 0)
      {
***************
*** 2229,2241 ****
             terminal_type);
  #endif
      }
! #ifdef TERMINFO
!   area = (char *) xmalloc (2044);
! #else
!   area = (char *) xmalloc (strlen (buffer));
! #endif /* not TERMINFO */
!   if (area == 0)
      abort ();
  
    TS_ins_line = tgetstr ("al", address);
    TS_ins_multi_lines = tgetstr ("AL", address);
--- 2228,2238 ----
             terminal_type);
  #endif
      }
! 
!   if (strlen (buffer) >= buffer_size)
      abort ();
+   
+   area = (char *) xmalloc (strlen (buffer));
  
    TS_ins_line = tgetstr ("al", address);
    TS_ins_multi_lines = tgetstr ("AL", address);
***************
*** 2560,2565 ****
--- 2557,2564 ----
    FRAME_CAN_HAVE_SCROLL_BARS (sf) = 0;
    FRAME_VERTICAL_SCROLL_BAR_TYPE (sf) = vertical_scroll_bar_none;
  #endif /* WINDOWSNT */
+ 
+   xfree (buffer);
  }
  
  /* VARARGS 1 */




reply via email to

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