From c2e1b7e66797c59f3922aac8e396d724e565cacd Mon Sep 17 00:00:00 2001 From: Edward Wang Date: Wed, 18 Nov 1992 05:40:51 -0800 Subject: [PATCH] searchheaders SCCS-vsn: usr.bin/mail/list.c 5.16 SCCS-vsn: usr.bin/mail/mail.1 6.20 --- usr/src/usr.bin/mail/list.c | 13 ++++++++++--- usr/src/usr.bin/mail/mail.1 | 6 +++++- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/usr/src/usr.bin/mail/list.c b/usr/src/usr.bin/mail/list.c index 7d06f65b76..12021c6c06 100644 --- a/usr/src/usr.bin/mail/list.c +++ b/usr/src/usr.bin/mail/list.c @@ -6,7 +6,7 @@ */ #ifndef lint -static char sccsid[] = "@(#)list.c 5.15 (Berkeley) %G%"; +static char sccsid[] = "@(#)list.c 5.16 (Berkeley) %G%"; #endif /* not lint */ #include "rcv.h" @@ -667,8 +667,15 @@ matchsubj(str, mesg) * Now look, ignoring case, for the word in the string. */ - cp = str; - cp2 = hfield("subject", mp); + if (value("searchheaders") && (cp = index(str, ':'))) { + *cp++ = '\0'; + cp2 = hfield(str, mp); + cp[-1] = ':'; + str = cp; + } else { + cp = str; + cp2 = hfield("subject", mp); + } if (cp2 == NOSTR) return(0); backup = cp2; diff --git a/usr/src/usr.bin/mail/mail.1 b/usr/src/usr.bin/mail/mail.1 index 24c16d42dd..962302dc4d 100644 --- a/usr/src/usr.bin/mail/mail.1 +++ b/usr/src/usr.bin/mail/mail.1 @@ -3,7 +3,7 @@ .\" .\" %sccs.include.redist.roff% .\" -.\" @(#)mail.1 6.19 (Berkeley) %G% +.\" @(#)mail.1 6.20 (Berkeley) %G% .\" .Dd .Dt MAIL 1 @@ -852,6 +852,10 @@ and commands. .It Ar quiet Suppresses the printing of the version when first invoked. +.It Ar searchheaders +If this option is set, then a message-list specifier in the form ``/x:y'' +will expand to all messages containing the substring ``y'' in the header +field ``x''. The string search is case insensitive. .It Ar verbose Setting the option .Ar verbose -- 2.20.1