fix jessie packaging patch for 1.31.4

This commit is contained in:
Jean-Francois Dockes 2021-11-25 13:48:54 +01:00
parent fb1876dfd0
commit fd15540895

View File

@ -1,5 +1,5 @@
diff --git a/src/internfile/mh_mbox.cpp b/src/internfile/mh_mbox.cpp
index c77d42c8..bdebbac6 100644
index c77d42c8..ccd6a613 100644
--- a/internfile/mh_mbox.cpp
+++ b/internfile/mh_mbox.cpp
@@ -27,6 +27,7 @@
@ -19,32 +19,33 @@ index c77d42c8..bdebbac6 100644
int msgnum{0}; // Current message number in folder. Starts at 1
int64_t lineno{0}; // debug
int64_t fsize{0};
@@ -324,10 +325,10 @@ void MimeHandlerMbox::clear_impl()
@@ -322,13 +323,6 @@ void MimeHandlerMbox::clear_impl()
m->fn.erase();
m->ipath.erase();
// We used to use m->instream = ifstream() which fails with some compilers, as the copy
// constructor is marked deleted in standard c++ (works with many compilers though).
- // We used to use m->instream = ifstream() which fails with some compilers, as the copy
- // constructor is marked deleted in standard c++ (works with many compilers though).
- if (m->instream.is_open()) {
- m->instream.close();
+ if (m->instream->is_open()) {
+ m->instream->close();
}
- }
- m->instream.clear();
+ m->instream->clear();
-
m->msgnum = 0;
m->lineno = 0;
@@ -346,8 +347,8 @@ bool MimeHandlerMbox::set_document_file_impl(const string&, const string &fn)
m->fsize = 0;
@@ -346,8 +340,9 @@ bool MimeHandlerMbox::set_document_file_impl(const string&, const string &fn)
LOGDEB("MimeHandlerMbox::set_document_file(" << fn << ")\n");
clear_impl();
m->fn = fn;
- m->instream.open(fn.c_str(), std::ifstream::binary);
- if (!m->instream.good()) {
+ m->instream->open(fn.c_str(), std::ifstream::binary);
+ m->instream = std::unique_ptr<ifstream>(
+ new ifstream(fn.c_str(), std::ifstream::binary));
+ if (!m->instream->good()) {
LOGSYSERR("MimeHandlerMail::set_document_file", "ifstream", fn);
return false;
}
@@ -396,13 +397,13 @@ bool MimeHandlerMbox::Internal::tryUseCache(int mtarg)
@@ -396,13 +391,13 @@ bool MimeHandlerMbox::Internal::tryUseCache(int mtarg)
fsize)) < 0) {
goto out;
}
@ -62,7 +63,7 @@ index c77d42c8..bdebbac6 100644
LOGSYSERR("tryUseCache", "getline", "");
goto out;
}
@@ -411,7 +412,7 @@ bool MimeHandlerMbox::Internal::tryUseCache(int mtarg)
@@ -411,7 +406,7 @@ bool MimeHandlerMbox::Internal::tryUseCache(int mtarg)
if ((fromregex(line) ||
((quirks & MBOXQUIRK_TBIRD) && minifromregex(line))) ) {
LOGDEB0("MimeHandlerMbox: Cache: From_ Ok\n");
@ -71,7 +72,7 @@ index c77d42c8..bdebbac6 100644
msgnum = mtarg -1;
cachefound = true;
} else {
@@ -421,7 +422,7 @@ bool MimeHandlerMbox::Internal::tryUseCache(int mtarg)
@@ -421,7 +416,7 @@ bool MimeHandlerMbox::Internal::tryUseCache(int mtarg)
out:
if (!cachefound) {
// No cached result: scan.
@ -80,7 +81,7 @@ index c77d42c8..bdebbac6 100644
msgnum = 0;
}
return cachefound;
@@ -429,7 +430,7 @@ out:
@@ -429,7 +424,7 @@ out:
bool MimeHandlerMbox::next_document()
{
@ -89,7 +90,7 @@ index c77d42c8..bdebbac6 100644
LOGERR("MimeHandlerMbox::next_document: not open\n");
return false;
}
@@ -465,10 +466,10 @@ bool MimeHandlerMbox::next_document()
@@ -465,10 +460,10 @@ bool MimeHandlerMbox::next_document()
msgtxt.erase();
string line;
for (;;) {