X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=from.c;h=59317898ca6eb5d91e7c1489554971202f6e28e8;hp=712205238cd96632327da1100bf0fd99b4511826;hb=ee48d4232053aee30adb5afb48b147e31d7aedfa;hpb=23e6291cb5d5b4cd2008403d8b628007fd75ff23 diff --git a/from.c b/from.c index 7122052..5931789 100644 --- a/from.c +++ b/from.c @@ -7,27 +7,10 @@ * please see the file GPL in the top level source directory. */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include - -#include -#include -#include +#include #include "mutt.h" -static const char *next_word(const char *s) -{ - while (*s && !ISSPACE(*s)) - s++; - s = skipspaces(s); - return s; -} - int mutt_check_month (const char *s) { int i; @@ -67,7 +50,8 @@ int is_from (const char *s, char *path, ssize_t pathlen, time_t * tp) if (m_strncmp("From ", s, 5) != 0) return 0; - s = next_word (s); /* skip over the From part. */ + s = m_strnextsp(s); /* skip over the From part. */ + s = skipspaces(s); if (!*s) return 0; @@ -106,7 +90,8 @@ int is_from (const char *s, char *path, ssize_t pathlen, time_t * tp) } } - s = next_word (s); + s = m_strnextsp(s); + s = skipspaces(s); if (!*s) return 0; @@ -115,7 +100,8 @@ int is_from (const char *s, char *path, ssize_t pathlen, time_t * tp) * is the same as a three-letter abbreviation of the day of the week. */ if (is_day_name (s)) { - s = next_word (s); + s = m_strnextsp(s); + s = skipspaces(s); if (!*s) return 0; } @@ -125,14 +111,16 @@ int is_from (const char *s, char *path, ssize_t pathlen, time_t * tp) return 0; /* day */ - s = next_word (s); + s = m_strnextsp(s); + s = skipspaces(s); if (!*s) return 0; if (sscanf (s, "%d", &tm.tm_mday) != 1) return 0; /* time */ - s = next_word (s); + s = m_strnextsp(s); + s = skipspaces(s); if (!*s) return 0; @@ -143,13 +131,15 @@ int is_from (const char *s, char *path, ssize_t pathlen, time_t * tp) else return 0; - s = next_word (s); + s = m_strnextsp(s); + s = skipspaces(s); if (!*s) return 0; /* timezone? */ if (isalpha ((unsigned char) *s) || *s == '+' || *s == '-') { - s = next_word (s); + s = m_strnextsp(s); + s = skipspaces(s); if (!*s) return 0; @@ -158,7 +148,8 @@ int is_from (const char *s, char *path, ssize_t pathlen, time_t * tp) * From xxxx@yyyyyyy.fr Wed Aug 2 00:39:12 MET DST 1995 */ if (isalpha ((unsigned char) *s)) { - s = next_word (s); + s = m_strnextsp(s); + s = skipspaces(s); if (!*s) return 0; }