visual.c of vnews with fixes.

h stan at teltone.UUCP
Fri Oct 28 03:16:13 AEST 1983


The new visual.c seems to work pretty well but there is one other bug
that was missed.  Without this fix, vnews comes up with the "mail"
message displayed whether you have mail or not.  It should not display
"mail" if you have a 0-length mail spool file.  (Of course, if you use
the MAIL environment variable you wouldn't have noticed this problem.)
Two statements in getmailname() in the visual.c file need to be changed.
See below; just the 2 sprintf statements need be changed.

char *
getmailname() {
	static char mailname[32];
	register char *p;

	if( (p = getenv("MAIL")) != NULL)
		return p;
	if (username[0] == '\0' || strlen(username) > 15)
		return NULL;
#ifdef BSD
/*	sprintf(mailname, "/usr/spool/mail/%s", p);
/*		--should use username rather than NULL here--10/27/83  */
	sprintf(mailname, "/usr/spool/mail/%s", username);
#else
/*	sprintf(mailname, "/usr/mail/%s", p);
/*		--should use username rather than NULL here--10/27/83  */
	sprintf(mailname, "/usr/mail/%s", username);
#endif
	return mailname;
}



More information about the Comp.sources.unix mailing list