From c52f0860cd357f5c37605db4ed5bc94ac75ab8d5 Mon Sep 17 00:00:00 2001 From: "Kurt A. Schoens" Date: Fri, 17 Oct 1980 02:46:56 -0800 Subject: [PATCH] initial header printing now attempts to start the header listing at the first new message (failing that, at the first message as before) SCCS-vsn: usr.bin/mail/lex.c 1.6 --- usr/src/usr.bin/mail/lex.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/usr/src/usr.bin/mail/lex.c b/usr/src/usr.bin/mail/lex.c index 4cd65f49fe..34b55123fd 100644 --- a/usr/src/usr.bin/mail/lex.c +++ b/usr/src/usr.bin/mail/lex.c @@ -8,7 +8,7 @@ * Lexical processing of commands. */ -static char *SccsId = "@(#)lex.c 1.5 %G%"; +static char *SccsId = "@(#)lex.c 1.6 %G%"; /* * Set up editing on the given file name. @@ -483,7 +483,13 @@ announce(pr) extern char *version; register struct message *mp; - vec[0] = 1; + for (mp = &message[0]; mp < &message[msgCount]; mp++) + if (mp->m_flag & MNEW) + break; + if (mp < &message[msgCount]) + vec[0] = mp - &message[0] + 1; + else + vec[0] = 1; vec[1] = 0; if (pr && value("quiet") == NOSTR) printf(greeting, version); -- 2.20.1