diff options
author | mikeh <mikeh@FreeBSD.org> | 2001-12-18 20:52:09 +0000 |
---|---|---|
committer | mikeh <mikeh@FreeBSD.org> | 2001-12-18 20:52:09 +0000 |
commit | e4034fe298af9398dae0cac602d8a28ec6e51489 (patch) | |
tree | 89731abafbceb13b0e7b78a6e281339c99fbfef9 /usr.bin/mail/cmd1.c | |
parent | 1750942f6f64d20cc8853d2d1a60a3daaeeb1110 (diff) | |
download | FreeBSD-src-e4034fe298af9398dae0cac602d8a28ec6e51489.zip FreeBSD-src-e4034fe298af9398dae0cac602d8a28ec6e51489.tar.gz |
Sync with most of NetBSD's changes, including:
*) Sync with 4.4BSD-Lite2
*) Set usecs for utimes()
*) Add 'inc' command and 'autoinc' option that check for new mail
manually and automatically, respectively
*) Use POSIX signal handling and tty semantics
*) Handle long lines correctly when paging messages
*) Add ability to explicitly search 'To:' line
*) Various manpage cleanups
*) Support overriding '~/.mailrc' with $MAILRC
*) Support 'askbcc' and 'asksub' options
*) Fix various bugs
Reviewed by: ru (mail.1)
Obtained from: NetBSD
Diffstat (limited to 'usr.bin/mail/cmd1.c')
-rw-r--r-- | usr.bin/mail/cmd1.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/usr.bin/mail/cmd1.c b/usr.bin/mail/cmd1.c index aa5ad53..8c51077 100644 --- a/usr.bin/mail/cmd1.c +++ b/usr.bin/mail/cmd1.c @@ -33,7 +33,7 @@ #ifndef lint #if 0 -static char sccsid[] = "@(#)cmd1.c 8.1 (Berkeley) 6/6/93"; +static char sccsid[] = "@(#)cmd1.c 8.2 (Berkeley) 4/20/95"; #endif static const char rcsid[] = "$FreeBSD$"; @@ -111,7 +111,7 @@ scroll(arg) case 0: case '+': s++; - if (s * size > msgCount) { + if (s * size >= msgCount) { printf("On last screenful of messages\n"); return (0); } @@ -460,3 +460,26 @@ folders() (void)run_command(cmd, 0, -1, -1, dirname, NULL, NULL); return (0); } + +/* + * Update the mail file with any new messages that have + * come in since we started reading mail. + */ +int +inc(v) + void *v; +{ + int nmsg, mdot; + + nmsg = incfile(); + + if (nmsg == 0) + printf("No new mail.\n"); + else if (nmsg > 0) { + mdot = newfileinfo(msgCount - nmsg); + dot = &message[mdot - 1]; + } else + printf("\"inc\" command failed...\n"); + + return (0); +} |