From 1776f4f8b02acf2e13d05d0ebe5d4f449239a909 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Sat, 2 Oct 2021 20:38:40 +0000 Subject: dash: Just zero mailsize on changemail So that on start (and any time MAIL/MAILPATH change), any non-empty mailboxes will be reported. --- src/mail.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/mail.c b/src/mail.c index ec5bd10..a657153 100644 --- a/src/mail.c +++ b/src/mail.c @@ -38,6 +38,7 @@ #include #include #include +#include #include "shell.h" #include "nodes.h" @@ -54,14 +55,11 @@ /* sizes of mailboxes */ static off_t mailsize[MAXMBOXES]; -/* Set if MAIL or MAILPATH is changed. */ -static int changed; /* - * Print appropriate message(s) if mail has arrived. If changed is set, - * then the value of MAIL has changed, so we just update the values. + * Print appropriate message(s) if mail has arrived. */ void @@ -95,7 +93,7 @@ chkmail(void) *msp = 0; continue; } - if (!changed && statb.st_size > *msp) { + if (statb.st_size > *msp) { outfmt( &errout, snlfmt, pathopt ? pathopt : "you have mail" @@ -103,7 +101,6 @@ chkmail(void) } *msp = statb.st_size; } - changed = 0; popstackmark(&smark); } @@ -111,5 +108,5 @@ chkmail(void) void changemail(const char *val) { - changed++; + memset(mailsize, 0, sizeof(mailsize)); } -- cgit 1.4.1