* lib: do some more escaping of body text
This commit is contained in:
@ -459,6 +459,19 @@ add_terms_values_attach (Xapian::Document& doc, MuMsg *msg,
|
||||
(MuMsgPartForeachFunc)each_part, &pdata);
|
||||
}
|
||||
|
||||
/* escape the body -- for now, only replace '-' with '_' */
|
||||
static void
|
||||
body_escape_in_place (char *body)
|
||||
{
|
||||
while (*body) {
|
||||
switch (*body) {
|
||||
case '-': *body = '_';
|
||||
default: break;
|
||||
}
|
||||
++body;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
add_terms_values_body (Xapian::Document& doc, MuMsg *msg,
|
||||
@ -482,6 +495,8 @@ add_terms_values_body (Xapian::Document& doc, MuMsg *msg,
|
||||
|
||||
/* norm is allocated on strchunk, no need for freeing */
|
||||
norm = mu_str_normalize (str, TRUE, strchunk);
|
||||
body_escape_in_place (norm);
|
||||
|
||||
termgen.index_text_without_positions (norm, 1, prefix(mfid));
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Date: Thu, 31 Jul 2008 14:57:25 -0400
|
||||
From: "Socrates" <soc@example.com>
|
||||
Subject: cool stuff
|
||||
Subject: cool stuff
|
||||
To: "Alcibiades" <alki@example.com>
|
||||
Message-id: <3BE9E6535E0D852173@emss35m06.us.lmco.com>
|
||||
MIME-version: 1.0
|
||||
@ -9,5 +9,6 @@ Content-transfer-encoding: 7BIT
|
||||
Precedence: high
|
||||
|
||||
The hour of departure has arrived, and we go our ways—I to die, and you to
|
||||
live. Which is better God only knows.
|
||||
live. Which is better God only knows.
|
||||
|
||||
http-emacs
|
||||
|
||||
Reference in New Issue
Block a user