From cfe08f2ca21af629f74268f1f1425a5fec0494cd Mon Sep 17 00:00:00 2001 From: Pierre Habouzit Date: Thu, 16 Aug 2007 09:55:40 +0200 Subject: [PATCH] Rewrite is_from efficiently, and put it in lib-mime where it belongs. Signed-off-by: Pierre Habouzit --- CMakeLists.txt | 1 - from.c | 168 ----------------------------------------- globals.h | 2 - imap/util.c | 1 - lib-mime/mime.h | 1 + lib-mime/rfc822parse.c | 67 ++++++++++++++++ protos.h | 2 - 7 files changed, 68 insertions(+), 174 deletions(-) delete mode 100644 from.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 8637b37..67bede3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -288,7 +288,6 @@ MADMUTT_SOURCES(madmuttsrc madmuttgen copy.c editmsg.c flags.c - from.c handler.c headers.c help.c diff --git a/from.c b/from.c deleted file mode 100644 index 5931789..0000000 --- a/from.c +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright notice from original mutt: - * Copyright (C) 1996-2000 Michael R. Elkins - * - * This file is part of mutt-ng, see http://www.muttng.org/. - * It's licensed under the GNU General Public License, - * please see the file GPL in the top level source directory. - */ - -#include - -#include "mutt.h" - -int mutt_check_month (const char *s) -{ - int i; - - for (i = 0; i < 12; i++) - if (m_strncasecmp(s, Months[i], 3) == 0) - return (i); - return (-1); /* error */ -} - -static int is_day_name (const char *s) -{ - int i; - - if ((m_strlen(s) < 3) || !*(s + 3) || !ISSPACE (*(s + 3))) - return 0; - for (i = 0; i < 7; i++) - if (m_strncasecmp(s, Weekdays[i], 3) == 0) - return 1; - return 0; -} - -/* - * A valid message separator looks like: - * - * From [ ]