X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=send.c;h=c687492de6043864f8fb64815feb550ca3fdf6b7;hp=7391e91e106d59ae9d89041e3829a484d00276f3;hb=16392434eb28ef16069eae972640e1f534477f83;hpb=0bf7fde20048a2b0c5af096545979d678aba44cf diff --git a/send.c b/send.c index 7391e91..c687492 100644 --- a/send.c +++ b/send.c @@ -16,6 +16,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include "mutt.h" #include "mutt_curses.h" #include "rfc2047.h" @@ -71,10 +75,6 @@ static void append_signature (FILE *f) } } -static void append_signoff_string(FILE *f) -{ -} - /* compare two e-mail addresses and return 1 if they are equivalent */ static int mutt_addrcmp (ADDRESS *a, ADDRESS *b) { @@ -227,6 +227,7 @@ static int edit_envelope (ENVELOPE *en, int flags) { char buf[HUGE_STRING]; LIST *uh = UserHeader; + regmatch_t pat_match[1]; #ifdef USE_NNTP if (option (OPTNEWSSEND)) @@ -291,7 +292,19 @@ static int edit_envelope (ENVELOPE *en, int flags) } } } - + + if ((flags & (SENDREPLY)) && option (OPTSTRIPWAS) && StripWasRegexp.rx && + regexec (StripWasRegexp.rx, buf, 1, pat_match, 0) == 0) { + unsigned int pos = pat_match->rm_so; + if (ascii_strncasecmp (buf, "re: ", pos) != 0) { + buf[pos] = '\0'; /* kill match */ + while (pos-- && buf[pos] == ' ') + buf[pos] = '\0'; /* remove trailing spaces */ + } else { + mutt_error (_("Ignoring $strip_was: Subject would be empty.")); + sleep (2); + } + } if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) != 0 || (!buf[0] && query_quadoption (OPT_SUBJECT, _("No subject, abort?")) != M_NO)) {