Keith Sklower <sklower@vangogh.CS.Berkeley.EDU> sent me this months ago and I just found it in my inbox. I plan to commit it after the code freeze ends but I want it in the PR database so I don't forget again. Sorry for dropping the ball on this Keith, please make further submissions through send-pr(1) if possible. --- From: Keith Sklower <sklower@vangogh.CS.Berkeley.EDU> To: murray@FreeBSD.org Date: Sat, 4 Jan 2003 14:50:10 -0800 (PST) Hi, I use /usr/bin/Mail daily and love it. I sort my mail once a month by which time I have 3,000 -5,000 messages. Because my name is plastered over many websites for RFC's and past contributions to BSD, I get many copies of the klez virus. I've been having to go through by hand and look for any messages over 1500 lines, and finally got sick of it, having goofed and lost and hour of tedious work. Here are some changes to /usr/src/usr.bin/mail/list.c which let me say % Mail f >1000 or s <5000b probably_good (once could argue whether or not there should be a "searchsizes" variable like there is a "searchheaders" variable since this is a change from past behaviours ...) Please forward this to whoever is appropriate to judge such contributions! THanks! Respectfully Keith Sklower %diff -u list.c.org list.c --- list.c.org Fri Mar 15 11:46:32 2002 +++ list.c Sat Jan 4 14:02:44 2003 @@ -277,8 +277,12 @@ mc++; break; } - } - else { + } else if (**np == '>' || **np == '<') { + if (matchsize(*np, i)) { + mc++; + break; + } + } else { if (matchsender(*np, i)) { mc++; break; @@ -684,6 +688,34 @@ } } return (*cp == '\0'); +} +/* + * See if the message is of the desired size. Return true if so. + */ +int +matchsize(str, mesg) + char *str; + int mesg; +{ + char *cp, *cp2, *backup, *end; + long size, *msg_size; + struct message *mp = &message[mesg - 1]; + + if (*str == '\0')/* null string matches nothing instead of everything */ + return (0); + + size = strtol(str+1, &end, 10); + if (end == (str+1)) + return (matchsender(str, mesg)); + switch (*end) { + case 'b': case 'B': case 'c': case 'C': + msg_size = &(mp->m_size); + break; + + default: + msg_size = &(mp->m_lines); + } + return ((*str == '<') ? (*msg_size < size) : (*msg_size > size)); } /*
Responsible Changed From-To: freebsd-bugs->murray Assign to murray, who this is really a reminder for.
Responsible Changed From-To: murray->freebsd-ports-bugs Murray has returned his src bit for safekeeping.
Responsible Changed From-To: freebsd-ports-bugs->freebsd-bugs bin pr, mail is part of the base system
For bugs matching the following criteria: Status: In Progress Changed: (is less than) 2014-06-01 Reset to default assignee and clear in-progress tags. Mail being skipped
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>