never ``find'' the first one, but always take the following one
SCCS-vsn: usr.bin/mail/cmd2.c 1.2
-static char *SccsId = "@(#)cmd2.c 1.1 %G%";
+static char *SccsId = "@(#)cmd2.c 1.2 %G%";
/*
* If any arguments were given, go to the next applicable argument
/*
* If any arguments were given, go to the next applicable argument
*/
mdot = dot - &message[0] + 1;
*/
mdot = dot - &message[0] + 1;
+
+ /*
+ * Find the first message in the supplied
+ * message list which follows dot.
+ */
+
for (ip = msgvec; *ip != NULL; ip++)
if (*ip > mdot)
break;
for (ip = msgvec; *ip != NULL; ip++)
if (*ip > mdot)
break;
ip = msgvec;
ip2 = ip;
do {
ip = msgvec;
ip2 = ip;
do {
- if (*ip2 != NULL)
- ip2++;
- if (*ip2 == NULL)
- ip2 = msgvec;
mp = &message[*ip2 - 1];
if ((mp->m_flag & MDELETED) == 0) {
dot = mp;
goto hitit;
}
mp = &message[*ip2 - 1];
if ((mp->m_flag & MDELETED) == 0) {
dot = mp;
goto hitit;
}
+ if (*ip2 != NULL)
+ ip2++;
+ if (*ip2 == NULL)
+ ip2 = msgvec;
} while (ip2 != ip);
printf("No messages applicable\n");
return(1);
} while (ip2 != ip);
printf("No messages applicable\n");
return(1);