From: Kurt A. Schoens Date: Fri, 17 Oct 1980 16:16:30 +0000 (-0800) Subject: Changed touch() to set MREAD, and if MREAD wasn't set before, X-Git-Tag: BSD-4^3~262 X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/commitdiff_plain/dffe7e4f51c1291e01c9f3e08411351ea185183e Changed touch() to set MREAD, and if MREAD wasn't set before, to set MSTATUS. SCCS-vsn: usr.bin/mail/aux.c 1.2 --- diff --git a/usr/src/usr.bin/mail/aux.c b/usr/src/usr.bin/mail/aux.c index 31483fb189..0330e3888d 100644 --- a/usr/src/usr.bin/mail/aux.c +++ b/usr/src/usr.bin/mail/aux.c @@ -11,7 +11,7 @@ * Auxiliary functions. */ -static char *SccsId = "@(#)aux.c 1.1 %G%"; +static char *SccsId = "@(#)aux.c 1.2 %G%"; /* * Return a pointer to a dynamic copy of the argument. @@ -98,8 +98,14 @@ prs(str) touch(mesg) { - if (mesg >= 1 && mesg <= msgCount) - message[mesg-1].m_flag |= MTOUCH; + register struct message *mp; + + if (mesg < 1 || mesg > msgCount) + return; + mp = &message[mesg-1]; + mp->m_flag |= MTOUCH; + if ((mp->m_flag & MREAD) == 0) + mp->m_flag |= MREAD|MSTATUS; } /*