Changed touch() to set MREAD, and if MREAD wasn't set before,
authorKurt A. Schoens <kas@ucbvax.Berkeley.EDU>
Fri, 17 Oct 1980 16:16:30 +0000 (08:16 -0800)
committerKurt A. Schoens <kas@ucbvax.Berkeley.EDU>
Fri, 17 Oct 1980 16:16:30 +0000 (08:16 -0800)
to set MSTATUS.

SCCS-vsn: usr.bin/mail/aux.c 1.2

usr/src/usr.bin/mail/aux.c

index 31483fb..0330e38 100644 (file)
@@ -11,7 +11,7 @@
  * Auxiliary functions.
  */
 
  * 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.
 
 /*
  * Return a pointer to a dynamic copy of the argument.
@@ -98,8 +98,14 @@ prs(str)
 
 touch(mesg)
 {
 
 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;
 }
 
 /*
 }
 
 /*