Subject: clisp core dump, with fix

From: Raymond Toy <[email-masked]>
Date: Tue, 16 May 1995 11:41:58 -0400

While running clisp 04-25 compiled for sunos4.1.3_U1 with gcc 2.6.3, I
got a core dump while typing in an expression spanning two lines.  

I tracked down the core dump to newreadline/display.c.  It attempts to
find the length of NULL.  A patch is appended to fix this problem.  I
presume this problem also exists in GNU's readline library...

*** display.c~  Fri Apr 21 09:10:04 1995
--- display.c   Tue May 16 11:25:14 1995
***************
*** 214,220 ****
        return r;
      }
  
!   l = strlen (pmt);
    r = ret = xmalloc (l + 1);
    
    for (rl = ignoring = 0, p = pmt; p && *p; p++)
--- 214,220 ----
        return r;
      }
  
!   l = pmt ? strlen (pmt) : 0;
    r = ret = xmalloc (l + 1);
    
    for (rl = ignoring = 0, p = pmt; p && *p; p++)
***************
*** 775,781 ****
       escape sequences (like drawing the `unbold' sequence without a
       corresponding `bold') that manifests itself on certain terminals. */
  
!   lendiff = strlen (local_prompt);
    if (current_line == 0 && !_rl_horizontal_scroll_mode &&
        lendiff > visible_length &&
        _rl_last_c_pos > 0 && (ofd - old) >= lendiff && term_cr)
--- 775,781 ----
       escape sequences (like drawing the `unbold' sequence without a
       corresponding `bold') that manifests itself on certain terminals. */
  
!   lendiff = local_prompt ? strlen (local_prompt) : 0;
    if (current_line == 0 && !_rl_horizontal_scroll_mode &&
        lendiff > visible_length &&
        _rl_last_c_pos > 0 && (ofd - old) >= lendiff && term_cr)

Ray