[1791] in testers
Re: rsaix 7.3: from
daemon@ATHENA.MIT.EDU (daemon@ATHENA.MIT.EDU)
Wed Aug 7 01:31:50 1991
From: jfc@demi.mit.edu (John F. Carr)
To: probe@MIT.EDU
Cc: testers@MIT.EDU
In-Reply-To: Your message of "Wed, 07 Aug 91 00:55:45 EDT."
Date: Wed, 07 Aug 91 01:31:56 EDT
Try this patch:
*** /source/athena/athena.bin/from/from.c Fri Jul 26 10:58:11 1991
--- from.c Wed Aug 7 01:28:59 1991
***************
*** 258,263 ****
--- 258,265 ----
windowsize.ws_col = 80; /* default assume 80 */
/* for the console window timestamp */
linelength = windowsize.ws_col - 6;
+ if (linelength < 32)
+ linelength = 32;
for (i = 1; i <= nmsgs; i++) {
if (verbose && !skip_message)
***************
*** 518,525 ****
char **headers;
int num_headers, winlength;
{
! int j, len, from_found = 0, subject_found = 0;
! char *p, *from_field, *subject_field, *buf, *buf1;
for(j = 0; j < num_headers; j++) {
p = index(headers[j], ':');
--- 520,527 ----
char **headers;
int num_headers, winlength;
{
! int j, len;
! char *p, *from_field = 0, *subject_field = 0, *buf, *buf1;
for(j = 0; j < num_headers; j++) {
p = index(headers[j], ':');
***************
*** 531,548 ****
while (p[0] == ' ')
p++;
from_field = p;
! if (subject_found)
break;
- from_found = 1;
- continue;
}
! if (strncmp("Subject", headers[j], 6) == 0) {
p++;
while (p[0] == ' ')
p++;
subject_field = p;
! subject_found = 1;
! if (from_found)
break;
}
}
--- 533,547 ----
while (p[0] == ' ')
p++;
from_field = p;
! if (subject_field)
break;
}
! else if (strncmp("Subject", headers[j], 7) == 0) {
p++;
while (p[0] == ' ')
p++;
subject_field = p;
! if (from_field)
break;
}
}
***************
*** 555,561 ****
--- 554,563 ----
}
buf[0] = '\0';
buf[winlength] = '\0';
+ if (from_field)
strncpy(buf, from_field, winlength);
+ else
+ strncpy(buf, "<<unknown sender>>", winlength);
len = strlen(buf);
if (len < 30)
len = 30;
***************
*** 568,574 ****
}
buf1[0] = '\0';
! if (subject_found)
strncpy(buf1, subject_field, winlength - len - 1);
printf("%-30s %s\n", buf, buf1);
--- 570,576 ----
}
buf1[0] = '\0';
! if (subject_field)
strncpy(buf1, subject_field, winlength - len - 1);
printf("%-30s %s\n", buf, buf1);