More cleanups

git-svn: trunk@3221
remotes/push_mirror/metadata
Nigel Horne 18 years ago
parent c01ff22d4b
commit 73ddf91f87
  1. 4
      ChangeLog
  2. 14
      libclamav/mbox.c
  3. 11
      libclamav/message.c

@ -1,3 +1,7 @@
Sat Sep 15 09:13:14 BST 2007 (njh)
----------------------------------
* libclamav: More cleanups
Fri Sep 14 20:16:20 CEST 2007 (tk)
----------------------------------
* libclamav/matcher-ac.c: minor optimisation

@ -2512,9 +2512,10 @@ parseEmailBody(message *messageIn, text *textIn, mbox_ctx *mctx, unsigned int re
htmltextPart = getTextPart(messages, multiparts);
if(htmltextPart >= 0)
aText = textAddMessage(aText, messages[htmltextPart]);
else
if(htmltextPart >= 0) {
if(messageGetBody(messages[htmltextPart]))
aText = textAddMessage(aText, messages[htmltextPart]);
} else
/*
* There isn't an HTML bit. If there's a
* multipart bit, it'll may be in there
@ -3187,14 +3188,13 @@ getTextPart(message *const messages[], size_t size)
size_t i;
int textpart = -1;
for(i = 0; i < size; i++) {
assert(messages[i] != NULL);
if(messageGetMimeType(messages[i]) == TEXT) {
for(i = 0; i < size; i++)
if(messages[i] && (messageGetMimeType(messages[i]) == TEXT)) {
if(strcasecmp(messageGetMimeSubtype(messages[i]), "html") == 0)
return (int)i;
textpart = (int)i;
}
}
return textpart;
}

@ -15,6 +15,8 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*
* TODO: Optimise messageExport, decodeLine, messageIsEncoding
*/
static char const rcsid[] = "$Id: message.c,v 1.195 2007/02/12 20:46:09 njh Exp $";
@ -1511,7 +1513,7 @@ messageExport(message *m, const char *dir, void *(*create)(void), void (*destroy
/*
* Find the filename to decode
*/
if(((enctype == YENCODE) && yEncBegin(m)) || ((i == 0) && yEncBegin(m))) {
if(((enctype == YENCODE) || (i == 0)) && yEncBegin(m)) {
const char *f;
/*
@ -1540,9 +1542,10 @@ messageExport(message *m, const char *dir, void *(*create)(void), void (*destroy
} else {
if(enctype == UUENCODE) {
/*
* The body will have been stripped out by the fast track visa
* system. Treat as plain/text, which means we'll still scan
* for funnies outside of the uuencoded portion.
* The body will have been stripped out by the
* fast track visa system. Treat as plain/text,
* which means we'll still scan for funnies
* outside of the uuencoded portion.
*/
cli_dbgmsg("messageExport: treat uuencode as text/plain\n");
enctype = m->encodingTypes[i] = NOENCODING;

Loading…
Cancel
Save