diff --git a/src/internfile/mh_mbox.cpp b/src/internfile/mh_mbox.cpp index 1b506c0e..f626b31f 100644 --- a/src/internfile/mh_mbox.cpp +++ b/src/internfile/mh_mbox.cpp @@ -22,10 +22,15 @@ #include #include "safesysstat.h" #include -#ifndef _WIN32 -#include -#else + +#if 1 || defined(_WIN32) +#define USING_STD_REGEX +#endif + +#ifdef USING_STD_REGEX #include +#else +#include #endif #include @@ -387,17 +392,16 @@ static const char *frompat = // exactly like: From ^M (From followed by space and eol). We only // test for this if QUIRKS_TBIRD is set static const char *miniTbirdFrom = "^From $"; -#ifndef _WIN32 +#ifndef USING_STD_REGEX static regex_t fromregex; static regex_t minifromregex; #define M_regexec(A,B,C,D,E) regexec(&(A),B,C,D,E) #else basic_regex fromregex; basic_regex minifromregex; -#define REG_ICASE std::regex_constants::icase #define REG_NOSUB std::regex_constants::nosubs #define REG_EXTENDED std::regex_constants::extended -#define M_regexec(A, B, C, D, E) regex_match(B,A) +#define M_regexec(A, B, C, D, E) (!regex_match(B,A)) #endif @@ -412,7 +416,7 @@ static void compileregexes() // that we are alone. if (regcompiled) return; -#ifndef _WIN32 +#ifndef USING_STD_REGEX regcomp(&fromregex, frompat, REG_NOSUB|REG_EXTENDED); regcomp(&minifromregex, miniTbirdFrom, REG_NOSUB|REG_EXTENDED); #else @@ -516,7 +520,7 @@ bool MimeHandlerMbox::next_document() ((m_quirks & MBOXQUIRK_TBIRD) && !M_regexec(minifromregex, line, 0, 0, 0))) ) { - LOGDEB1(("MimeHandlerMbox: msgnum %d, " + LOGDEB0(("MimeHandlerMbox: msgnum %d, " "From_ at line %d: [%s]\n", m_msgnum, m_lineno, line)); if (storeoffsets) m_offsets.push_back(message_end);