From 6e2da786ed334ef2a1fd9eb5aefe3814aff41cfd Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Tue, 20 Nov 2007 15:03:22 +0100 Subject: [PATCH] Simple search: Allow [~+%] to be \-escaped. Closes #2426. --- ChangeLog | 30 ++++++++++++++++++++++++++++++ doc/manual.xml.head | 7 +++++-- pattern.c | 17 +++++++++++++++-- 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c7557b0..3066a675 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2007-11-20 08:45 +0000 Rocco Rutte (3dd709959912) + + * configure.ac, strsep.c: Add glibc implementation of strsep() in case + a system misses it. Closes #2989. + +2007-11-20 08:44 +0000 Rocco Rutte (a177e28ebcd4) + + * lib.h, mbyte.c: Alternate fix for not calling + bind_textdomain_codeset() to fix Solaris build. + +2007-11-19 15:32 +0100 Rocco Rutte (033eba2d6834) + + * rfc3676.c: Make f=f handler multibyte-aware by not buffering flowed + content until it's finished. We now write out content as we read it + (which simplifies the code quite a bit) and properly flow multibyte + paragraphs. This should improve DelSp=yes handling where a flowed + paragraph may not have spaces at all except trailing ones for + flowable paragraphs (after concatenating lines we didn't have access + to the original break points any longer). We still split content by + ASCII space (this should be safe as f=f itself uses ASCII space to + mark flowable lines (even for languages that aren't expected to use + spaces, see DelSp). Closes #862. + +2007-11-15 13:17 +0100 Rocco Rutte (a0161768f631) + + * ChangeLog, doc/makedoc-defs.h, doc/makedoc.c: Fix more documentation + build issues. Define USE_SASL (for $smtp_authenticators) in makedoc- + defs.h, include it in makedoc.c to force doc rebuild if makedoc- + defs.h changes. + 2007-11-15 12:32 +0100 Rocco Rutte (8c5357e2b31c) * parse.c, protos.h, send.c: Properly parse and validate Message-IDs diff --git a/doc/manual.xml.head b/doc/manual.xml.head index 967ec4f7..fb5952d7 100644 --- a/doc/manual.xml.head +++ b/doc/manual.xml.head @@ -3943,8 +3943,11 @@ This example matches all mails which only has recipients from Germany. Mutt supports two versions of so called ``simple searches'' which are -issued if the pattern entered for searching, limiting and similar -operations does not actually contain a pattern modifier. +issued if the query entered for searching, limiting and similar +operations does not seem to be a valid pattern (i.e. it does not contain +one of these characters: ``~'', ``='' or ``%''). If the query is +supposed to contain one of these special characters, they must be escaped +by prepending a backslash (``\''). diff --git a/pattern.c b/pattern.c index ee167cc8..089499d1 100644 --- a/pattern.c +++ b/pattern.c @@ -1238,12 +1238,25 @@ static void quote_simple(char *tmp, size_t len, const char *p) void mutt_check_simple (char *s, size_t len, const char *simple) { char tmp[LONG_STRING]; + int do_simple = 1; + char *p; + + for (p = s; p && *p; p++) + { + if (*p == '\\' && *(p + 1)) + p++; + else if (*p == '~' || *p == '=' || *p == '%') + { + do_simple = 0; + break; + } + } /* XXX - is ascii_strcasecmp() right here, or should we use locale's * equivalences? */ - - if (!strchr (s, '~') && !strchr (s, '=') && !strchr (s, '%')) /* yup, so spoof a real request */ + + if (do_simple) /* yup, so spoof a real request */ { /* convert old tokens into the new format */ if (ascii_strcasecmp ("all", s) == 0 || -- 2.40.0