Hi,

   I've been installing 4.0-current and testing it. One of the
problems I've found is with the port elm2.4.ME+.68 ...

   /usr/ports/mail/elm/work/elm2.4.ME+.68/lib/can_open.c function
'can_open()' checks for the presence of the mail folder (which
doesn't exist). It returns an appropriate error.

   Unfortunately, we seem to loose the bad rc.

   /usr/ports/mail/elm/work/elm2.4.ME+.68/lib/mail_gets.c function
'mail_gets()' is called later with a NULL filepointer which is
then passed to feof() and ferror().

Starting "./bin/elm "
elm:\elm.c\main 42
> g
SIGSEGV - Segmentation violation.
elm:\mail_gets.c\mail_gets 31 (+0x6)

int mail_gets(buffer, size, mailfile)
     char *buffer;
     int size;
     FILE *mailfile;
{
        register int line_bytes = 0, ch;
        register char *c = buffer;

        size--; /* allow room for zero terminator on end, just in case */

31->>>  while (!feof(mailfile) && !ferror(mailfile) && line_bytes < size) {
          ch = getc(mailfile); /* Macro, faster than  fgetc() ! */


   Note, the above all works correctly if you actually have a valid
mail folder.

   The following patch fixes the problem, though I don't beleive
it is truely the correct fix.

--- lib/mail_gets.c.orig        Fri Jan 21 04:26:05 2000
+++ lib/mail_gets.c     Mon Feb 21 14:24:40 2000
@@ -26,6 +26,11 @@
        register int line_bytes = 0, ch;
        register char *c = buffer;
 
+        if (!mailfile) {
+          *c = 0;      /* Actually this should NOT be needed.. */
+           return line_bytes;
+        }
+
        size--; /* allow room for zero terminator on end, just in case */
 
        while (!feof(mailfile) && !ferror(mailfile) && line_bytes < size) {


 
Thanks,
John


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to