const string cleanup

This commit is contained in:
Jean-Francois Dockes
2011-10-01 16:39:38 +02:00
parent 7f0ca13e7f
commit 38e0957962
29 changed files with 268 additions and 170 deletions
+13 -17
View File
@@ -32,6 +32,7 @@
using namespace std;
#endif /* NO_NAMESPACES */
#include "cstr.h"
#include "internfile.h"
#include "rcldoc.h"
#include "mimetype.h"
@@ -51,7 +52,6 @@ using namespace std;
#include "pxattr.h"
#endif // RCL_USE_XATTR
static const string cstr_stxtplain("text/plain");
// The internal path element separator. This can't be the same as the rcldb
// file to ipath separator : "|"
@@ -206,7 +206,7 @@ void FileInterner::init(const string &f, const struct stat *stp, RclConfig *cnf,
// Indexing by udi makes things easier (because they sometimes get a temp
// as input
string udi;
make_udi(f, "", udi);
make_udi(f, cstr_null, udi);
cnf->setKeyDir(path_getfather(m_fn));
@@ -366,7 +366,7 @@ void FileInterner::initcommon(RclConfig *cnf, int flags)
m_handlers.reserve(MAXHANDLERS);
for (unsigned int i = 0; i < MAXHANDLERS; i++)
m_tmpflgs[i] = false;
m_targetMType = cstr_stxtplain;
m_targetMType = cstr_textplain;
}
// We used a single beagle cache object to access beagle data. We protect it
@@ -398,7 +398,7 @@ FileInterner::FileInterner(const Rcl::Doc& idoc, RclConfig *cnf,
if (backend.empty() || !backend.compare("FS")) {
// Filesystem document. Intern from file.
// The url has to be like file://
if (idoc.url.find("file://") != 0) {
if (idoc.url.find(cstr_fileu) != 0) {
LOGERR(("FileInterner: FS backend and non fs url: [%s]\n",
idoc.url.c_str()));
return;
@@ -565,13 +565,9 @@ static inline bool getKeyValue(const map<string, string>& docdata,
// These defs are for the Dijon meta array. Rcl::Doc predefined field
// names are used where appropriate. In some cases, Rcl::Doc names are
// used inside the Dijon metadata (ex: origcharset)
static const string cstr_keyau("author");
static const string cstr_keycs("charset");
static const string cstr_keyct("content");
static const string cstr_keyds("description");
static const string cstr_keyfn("filename");
static const string cstr_keymd("modificationdate");
static const string cstr_keymt("mimetype");
static const string cstr_keytt("title");
bool FileInterner::dijontorcl(Rcl::Doc& doc)
@@ -586,13 +582,13 @@ bool FileInterner::dijontorcl(Rcl::Doc& doc)
for (map<string,string>::const_iterator it = docdata.begin();
it != docdata.end(); it++) {
if (it->first == cstr_keyct) {
if (it->first == cstr_content) {
doc.text = it->second;
} else if (it->first == cstr_keymd) {
doc.dmtime = it->second;
} else if (it->first == Rcl::Doc::keyoc) {
doc.origcharset = it->second;
} else if (it->first == cstr_keymt || it->first == cstr_keycs) {
} else if (it->first == cstr_mimetype || it->first == cstr_charset) {
// don't need/want these.
} else {
doc.meta[it->first] = it->second;
@@ -632,18 +628,18 @@ void FileInterner::collectIpathAndMT(Rcl::Doc& doc) const
for (vector<Dijon::Filter*>::const_iterator hit = m_handlers.begin();
hit != m_handlers.end(); hit++) {
const map<string, string>& docdata = (*hit)->get_meta_data();
if (getKeyValue(docdata, "ipath", ipathel)) {
if (getKeyValue(docdata, cstr_ipath, ipathel)) {
if (!ipathel.empty()) {
// We have a non-empty ipath
hasipath = true;
getKeyValue(docdata, cstr_keymt, doc.mimetype);
getKeyValue(docdata, cstr_mimetype, doc.mimetype);
getKeyValue(docdata, cstr_keyfn, doc.utf8fn);
}
doc.ipath += colon_hide(ipathel) + cstr_isep;
} else {
doc.ipath += cstr_isep;
}
getKeyValue(docdata, cstr_keyau, doc.meta[Rcl::Doc::keyau]);
getKeyValue(docdata, cstr_author, doc.meta[Rcl::Doc::keyau]);
getKeyValue(docdata, cstr_keymd, doc.dmtime);
}
@@ -682,8 +678,8 @@ int FileInterner::addHandler()
{
const map<string, string>& docdata = m_handlers.back()->get_meta_data();
string charset, mimetype;
getKeyValue(docdata, cstr_keycs, charset);
getKeyValue(docdata, cstr_keymt, mimetype);
getKeyValue(docdata, cstr_charset, charset);
getKeyValue(docdata, cstr_mimetype, mimetype);
LOGDEB(("FileInterner::addHandler: next_doc is %s\n", mimetype.c_str()));
@@ -691,7 +687,7 @@ int FileInterner::addHandler()
// general), we're done decoding. If we hit text/plain, we're done
// in any case
if (!stringicmp(mimetype, m_targetMType) ||
!stringicmp(mimetype, cstr_stxtplain)) {
!stringicmp(mimetype, cstr_textplain)) {
m_reachedMType = mimetype;
LOGDEB1(("FileInterner::addHandler: target reached\n"));
return ADD_BREAK;
@@ -724,7 +720,7 @@ int FileInterner::addHandler()
const string *txt = &ns;
{
map<string,string>::const_iterator it;
it = docdata.find(cstr_keyct);
it = docdata.find(cstr_content);
if (it != docdata.end())
txt = &it->second;
}
+6 -6
View File
@@ -14,7 +14,7 @@
* Free Software Foundation, Inc.,
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "cstr.h"
#include "execmd.h"
#include "mh_exec.h"
#include "mh_html.h"
@@ -95,7 +95,7 @@ bool MimeHandlerExec::next_document()
myparams.push_back(m_ipath);
// Execute command, store the output
string& output = m_metaData["content"];
string& output = m_metaData[cstr_content];
output.erase();
ExecCmd mexec;
MEAdv adv(filtermaxseconds);
@@ -146,7 +146,7 @@ bool MimeHandlerExec::next_document()
void MimeHandlerExec::finaldetails()
{
string& output = m_metaData["content"];
string& output = m_metaData[cstr_content];
// If output is text/plain (not text/html), we may have to convert
// it to utf-8, because this is the last point where it can be done.
@@ -158,7 +158,7 @@ void MimeHandlerExec::finaldetails()
}
string mt = cfgFilterOutputMtype.empty() ? "text/html" :
cfgFilterOutputMtype;
if (!mt.compare("text/plain") && stringlowercmp("utf-8", charset)) {
if (!mt.compare(cstr_textplain) && stringlowercmp("utf-8", charset)) {
string transcoded;
int ecnt;
if (!transcode(output, transcoded, charset, "UTF-8", &ecnt)) {
@@ -183,8 +183,8 @@ void MimeHandlerExec::finaldetails()
// Supposed contents charset encoding. This could still be
// overridden by the content-type meta tag for html, but this is
// wasteful so we hope it's correct
m_metaData["charset"] = charset;
m_metaData["mimetype"] = mt;
m_metaData[cstr_charset] = charset;
m_metaData[cstr_mimetype] = mt;
string md5, xmd5, reason;
if (MD5File(m_fn, md5, &reason)) {
+14 -14
View File
@@ -19,6 +19,7 @@
#include <iostream>
#include <sstream>
#include "cstr.h"
#include "mh_execm.h"
#include "mh_html.h"
#include "debuglog.h"
@@ -85,7 +86,7 @@ bool MimeHandlerExecMultiple::readDataElement(string& name, string &data)
// Empty line (end of message) ?
if (!ibuf.compare("\n")) {
LOGDEB(("MHExecMultiple: Got empty line\n"));
name = "";
name.clear();
return true;
}
@@ -122,7 +123,7 @@ bool MimeHandlerExecMultiple::readDataElement(string& name, string &data)
// piece
string *datap = &data;
if (!stringlowercmp("document:", name)) {
datap = &m_metaData["content"];
datap = &m_metaData[cstr_content];
} else {
datap = &data;
}
@@ -163,7 +164,7 @@ bool MimeHandlerExecMultiple::next_document()
} else {
obuf << "Filename: " << 0 << "\n";
}
if (m_ipath.length()) {
if (!m_ipath.empty()) {
LOGDEB(("next_doc: sending len %d val [%s]\n", m_ipath.length(),
m_ipath.c_str()));
obuf << "Ipath: " << m_ipath.length() << "\n" << m_ipath;
@@ -238,7 +239,7 @@ bool MimeHandlerExecMultiple::next_document()
// It used to be that eof could be signalled just by an empty document, but
// this was wrong. Empty documents can be found ie in zip files and should
// not be interpreted as eof.
if (m_metaData["content"].length() == 0) {
if (m_metaData[cstr_content].empty()) {
LOGDEB0(("MHExecMultiple: got empty document inside [%s]: [%s]\n",
m_fn.c_str(), ipath.c_str()));
}
@@ -248,14 +249,14 @@ bool MimeHandlerExecMultiple::next_document()
// mimetype, or the ipath MUST be a filename-like string which we can use
// to compute a mime type
if (!ipath.empty()) {
m_metaData["ipath"] = ipath;
m_metaData[cstr_ipath] = ipath;
if (mtype.empty()) {
LOGDEB0(("MHExecMultiple: no mime type from filter, "
"using ipath for a guess\n"));
mtype = mimetype(ipath, 0, m_config, false);
if (mtype.empty()) {
// mimetype() won't call idFile when there is no file. Do it
mtype = idFileMem(m_metaData["content"]);
mtype = idFileMem(m_metaData[cstr_content]);
if (mtype.empty()) {
// Note this happens for example for directory zip members
// We could recognize them by the end /, but wouldn't know
@@ -265,13 +266,13 @@ bool MimeHandlerExecMultiple::next_document()
}
}
}
m_metaData["mimetype"] = mtype;
m_metaData[cstr_mimetype] = mtype;
string md5, xmd5;
MD5String(m_metaData["content"], md5);
MD5String(m_metaData[cstr_content], md5);
m_metaData["md5"] = MD5HexPrint(md5, xmd5);
} else {
m_metaData["mimetype"] = mtype.empty() ? "text/html" : mtype;
m_metaData.erase("ipath");
m_metaData[cstr_mimetype] = mtype.empty() ? "text/html" : mtype;
m_metaData.erase(cstr_ipath);
string md5, xmd5, reason;
if (MD5File(m_fn, md5, &reason)) {
m_metaData["md5"] = MD5HexPrint(md5, xmd5);
@@ -292,14 +293,13 @@ bool MimeHandlerExecMultiple::next_document()
charset = m_dfltInputCharset;
}
}
m_metaData["charset"] = charset;
m_metaData[cstr_charset] = charset;
if (eofnext_received)
m_havedoc = false;
LOGDEB0(("MHExecMultiple: returning %d bytes of content,"
" mtype [%s] charset [%s]\n",
m_metaData["content"].size(), m_metaData["mimetype"].c_str(),
m_metaData["charset"].c_str()));
" mtype [%s] charset [%s]\n", m_metaData[cstr_content].size(),
m_metaData[cstr_mimetype].c_str(), m_metaData[cstr_charset].c_str()));
return true;
}
+6 -6
View File
@@ -15,7 +15,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "cstr.h"
#include "mimehandler.h"
#include "debuglog.h"
#include "csguess.h"
@@ -74,7 +74,7 @@ bool MimeHandlerHtml::next_document()
LOGDEB(("MHHtml::next_doc.: default supposed input charset: [%s]\n",
charset.c_str()));
// Override default input charset if someone took care to set one:
map<string,string>::const_iterator it = m_metaData.find("charset");
map<string,string>::const_iterator it = m_metaData.find(cstr_charset);
if (it != m_metaData.end() && !it->second.empty()) {
charset = it->second;
LOGDEB(("MHHtml: next_doc.: input charset from metadata: [%s]\n",
@@ -102,7 +102,7 @@ bool MimeHandlerHtml::next_document()
transcoded = m_html;
// We don't know the charset, at all
p.reset_charsets();
charset = "";
charset.clear();
} else {
if (ecnt) {
if (pass == 0) {
@@ -163,13 +163,13 @@ bool MimeHandlerHtml::next_document()
}
m_metaData["origcharset"] = result.get_charset();
m_metaData["content"] = result.dump;
m_metaData["charset"] = "utf-8";
m_metaData[cstr_content] = result.dump;
m_metaData[cstr_charset] = "utf-8";
// Avoid setting empty values which would crush ones possibly inherited
// from parent (if we're an attachment)
if (!result.dmtime.empty())
m_metaData["modificationdate"] = result.dmtime;
m_metaData["mimetype"] = "text/plain";
m_metaData[cstr_mimetype] = cstr_textplain;
for (map<string,string>::const_iterator it = result.meta.begin();
it != result.meta.end(); it++) {
+13 -17
View File
@@ -25,6 +25,7 @@
#include <map>
#include <sstream>
#include "cstr.h"
#include "mimehandler.h"
#include "readfile.h"
#include "transcode.h"
@@ -43,17 +44,12 @@
using namespace std;
static const int maxdepth = 20;
static const string cstr_mimetype = "mimetype";
static const string cstr_content = "content";
static const string cstr_author = "author";
static const string cstr_recipient = "recipient";
static const string cstr_modificationdate = "modificationdate";
static const string cstr_title = "title";
static const string cstr_msgid = "msgid";
static const string cstr_abstract = "abstract";
static const string cstr_newline = "\n";
MimeHandlerMail::MimeHandlerMail(RclConfig *cnf, const string &mt)
: RecollFilter(cnf, mt), m_bincdoc(0), m_fd(-1), m_stream(0), m_idx(-1)
{
@@ -176,7 +172,7 @@ bool MimeHandlerMail::next_document()
bool res = false;
if (m_idx == -1) {
m_metaData[cstr_mimetype] = "text/plain";
m_metaData[cstr_mimetype] = cstr_textplain;
res = processMsg(m_bincdoc, 0);
LOGDEB1(("MimeHandlerMail::next_document: mimetype %s\n",
m_metaData[cstr_mimetype].c_str()));
@@ -185,7 +181,7 @@ bool MimeHandlerMail::next_document()
m_metaData[cstr_abstract] =
truncate_to_word(txt.substr(m_startoftext), 250);
} else {
m_metaData[cstr_abstract] = "";
m_metaData[cstr_abstract].clear();
res = processAttach();
}
m_idx++;
@@ -240,7 +236,7 @@ bool MimeHandlerMail::processAttach()
MHMailAttach *att = m_attachments[m_idx];
m_metaData[cstr_mimetype] = att->m_contentType;
m_metaData["charset"] = att->m_charset;
m_metaData[cstr_charset] = att->m_charset;
m_metaData["filename"] = att->m_filename;
// Change the title to something helpul
m_metaData[cstr_title] = att->m_filename + " (" + m_subject + ")";
@@ -263,12 +259,12 @@ bool MimeHandlerMail::processAttach()
// Special case for text/plain content. Internfile should deal
// with this but it expects text/plain to be utf-8 already, so we
// handle the transcoding if needed
if (m_metaData[cstr_mimetype] == "text/plain" &&
stringicmp(m_metaData["charset"], "UTF-8")) {
if (m_metaData[cstr_mimetype] == cstr_textplain &&
stringicmp(m_metaData[cstr_charset], "UTF-8")) {
string utf8;
if (!transcode(body, utf8, m_metaData["charset"], "UTF-8")) {
if (!transcode(body, utf8, m_metaData[cstr_charset], "UTF-8")) {
LOGERR((" processAttach: transcode to utf-8 failed "
"for charset [%s]\n", m_metaData["charset"].c_str()));
"for charset [%s]\n", m_metaData[cstr_charset].c_str()));
// Just let it through and hope for the best...
} else {
body = utf8;
@@ -288,7 +284,7 @@ bool MimeHandlerMail::processAttach()
// Ipath
char nbuf[20];
sprintf(nbuf, "%d", m_idx);
m_metaData["ipath"] = nbuf;
m_metaData[cstr_ipath] = nbuf;
return true;
}
@@ -452,7 +448,7 @@ void MimeHandlerMail::walkmime(Binc::MimePart* doc, int depth)
MimeHeaderValue content_type;
parseMimeHeaderValue(hi.getValue(), content_type);
LOGDEB2(("walkmime: C-type: %s\n",content_type.value.c_str()));
if (!stringlowercmp("text/plain", content_type.value))
if (!stringlowercmp(cstr_textplain, content_type.value))
ittxt = it;
else if (!stringlowercmp("text/html", content_type.value))
ithtml = it;
@@ -473,7 +469,7 @@ void MimeHandlerMail::walkmime(Binc::MimePart* doc, int depth)
// Get and parse content-type header.
Binc::HeaderItem hi;
string ctt = "text/plain";
string ctt = cstr_textplain;
if (doc->h.getFirstHeader("Content-Type", hi)) {
ctt = hi.getValue();
}
@@ -531,7 +527,7 @@ void MimeHandlerMail::walkmime(Binc::MimePart* doc, int depth)
// to iso-8859 only if the transfer-encoding is 8 bit, or test for
// actual 8 bit chars, but what the heck, le'ts use 8859-1 as default
string charset;
it = content_type.params.find(string("charset"));
it = content_type.params.find(string(cstr_charset));
if (it != content_type.params.end())
charset = it->second;
if (charset.empty() ||
@@ -555,7 +551,7 @@ void MimeHandlerMail::walkmime(Binc::MimePart* doc, int depth)
// attachment, as per rfc2183.
// If it is inline but not text or html, same thing.
if (stringlowercmp("inline", content_disposition.value) ||
(stringlowercmp("text/plain", content_type.value) &&
(stringlowercmp(cstr_textplain, content_type.value) &&
stringlowercmp("text/html", content_type.value)) ) {
if (!filename.empty()) {
out += "\n";
+8 -7
View File
@@ -29,6 +29,7 @@
#include <cstring>
#include <map>
#include "cstr.h"
#include "mimehandler.h"
#include "debuglog.h"
#include "readfile.h"
@@ -144,7 +145,7 @@ public:
string blk1;
blk1.append("udi=");
blk1.append(udi);
blk1.append("\n");
blk1.append(cstr_newline);
blk1.resize(o_b1size, 0);
if (fwrite(blk1.c_str(), 1, o_b1size, fp) != o_b1size) {
LOGDEB(("MboxCache::put_offsets: fwrite errno %d\n", errno));
@@ -384,7 +385,7 @@ bool MimeHandlerMbox::next_document()
}
FILE *fp = (FILE *)m_vfp;
int mtarg = 0;
if (m_ipath != "") {
if (!m_ipath.empty()) {
sscanf(m_ipath.c_str(), "%d", &mtarg);
} else if (m_forPreview) {
// Can't preview an mbox.
@@ -434,7 +435,7 @@ bool MimeHandlerMbox::next_document()
off_t message_end = 0;
bool iseof = false;
bool hademptyline = true;
string& msgtxt = m_metaData["content"];
string& msgtxt = m_metaData[cstr_content];
msgtxt.erase();
line_type line;
for (;;) {
@@ -498,8 +499,8 @@ bool MimeHandlerMbox::next_document()
// m_msgnum was incremented when hitting the next From_ or eof, so the data
// is for m_msgnum - 1
sprintf(buf, "%d", m_msgnum - 1);
m_metaData["ipath"] = buf;
m_metaData["mimetype"] = "message/rfc822";
m_metaData[cstr_ipath] = buf;
m_metaData[cstr_mimetype] = "message/rfc822";
if (iseof) {
LOGDEB2(("MimeHandlerMbox::next: eof hit\n"));
m_havedoc = false;
@@ -590,7 +591,7 @@ int main(int argc, char **argv)
exit(1);
}
map<string, string>::const_iterator it =
mh.get_meta_data().find("content");
mh.get_meta_data().find(cstr_content);
int size;
if (it == mh.get_meta_data().end()) {
size = -1;
@@ -610,7 +611,7 @@ int main(int argc, char **argv)
}
docnt++;
map<string, string>::const_iterator it =
mh.get_meta_data().find("content");
mh.get_meta_data().find(cstr_content);
int size;
if (it == mh.get_meta_data().end()) {
size = -1;
+5 -4
View File
@@ -27,6 +27,7 @@
using namespace std;
#endif /* NO_NAMESPACES */
#include "cstr.h"
#include "mh_text.h"
#include "csguess.h"
#include "debuglog.h"
@@ -122,7 +123,7 @@ bool MimeHandlerText::next_document()
m_dfltInputCharset.c_str()));
int ecnt;
bool ret;
string& itext = m_metaData["content"];
string& itext = m_metaData[cstr_content];
if (!(ret=transcode(m_text, itext, m_dfltInputCharset, "UTF-8", &ecnt)) ||
ecnt > int(itext.size() / 4)) {
LOGERR(("MimeHandlerText::mkDoc: transcode to utf-8 failed "
@@ -132,8 +133,8 @@ bool MimeHandlerText::next_document()
return false;
}
m_metaData["origcharset"] = m_dfltInputCharset;
m_metaData["charset"] = "utf-8";
m_metaData["mimetype"] = "text/plain";
m_metaData[cstr_charset] = "utf-8";
m_metaData[cstr_mimetype] = cstr_textplain;
// If text length is 0 (the file is empty or oversize), or we have
// read all at once, we're done
@@ -151,7 +152,7 @@ bool MimeHandlerText::next_document()
char buf[30];
sprintf(buf, "%lld", (long long)(m_offs - m_text.length()));
if (m_offs - m_text.length() != 0)
m_metaData["ipath"] = buf;
m_metaData[cstr_ipath] = buf;
readnext();
return true;
}
+5 -4
View File
@@ -19,6 +19,7 @@
#include <string>
#include "cstr.h"
#include "mimehandler.h"
/**
@@ -30,19 +31,19 @@ class MimeHandlerUnknown : public RecollFilter {
MimeHandlerUnknown(RclConfig *cnf, const string& mt)
: RecollFilter(cnf, mt) {}
virtual ~MimeHandlerUnknown() {}
virtual bool set_document_string(const string& fn) {
virtual bool set_document_file(const string& fn) {
RecollFilter::set_document_file(fn);
return m_havedoc = true;
}
virtual bool set_document_file(const string&) {
virtual bool set_document_string(const string&) {
return m_havedoc = true;
}
virtual bool next_document() {
if (m_havedoc == false)
return false;
m_havedoc = false;
m_metaData["content"] = "";
m_metaData["mimetype"] = "text/plain";
m_metaData[cstr_content] = cstr_null;
m_metaData[cstr_mimetype] = cstr_textplain;
return true;
}
virtual bool is_unknown() {return true;}
+5 -4
View File
@@ -24,6 +24,7 @@
#include <vector>
using namespace std;
#include "cstr.h"
#include "mimehandler.h"
#include "debuglog.h"
#include "rclconfig.h"
@@ -110,7 +111,7 @@ static Dijon::Filter *mhFactory(RclConfig *config, const string &mime)
LOGDEB2(("mhFactory(%s)\n", mime.c_str()));
string lmime(mime);
stringtolower(lmime);
if ("text/plain" == lmime) {
if (cstr_textplain == lmime) {
LOGDEB2(("mhFactory(%s): returning MimeHandlerText\n", mime.c_str()));
return new MimeHandlerText(config, lmime);
} else if ("text/html" == lmime) {
@@ -178,9 +179,9 @@ MimeHandlerExec *mhExecFactory(RclConfig *cfg, const string& mtype, string& hs,
// Handle additional attributes. We substitute the semi-colons
// with newlines and use a ConfSimple
string value;
if (attrs.get("charset", value))
if (attrs.get(cstr_charset, value))
h->cfgFilterOutputCharset = stringtolower((const string&)value);
if (attrs.get("mimetype", value))
if (attrs.get(cstr_mimetype, value))
h->cfgFilterOutputMtype = stringtolower((const string&)value);
#if 0
@@ -276,7 +277,7 @@ Dijon::Filter *getMimeHandler(const string &mtype, RclConfig *cfg,
// If the type is an unknown text/xxx, index as text/plain and
// hope for the best (this wouldn't work too well with text/rtf...)
if (mtype.find("text/") == 0) {
h = mhFactory("text/plain");
h = mhFactory(cstr_textplain);
goto out;
}
#endif
+4 -3
View File
@@ -27,6 +27,7 @@
#include <algorithm>
#include <cstring>
#include "cstr.h"
#include "myhtmlparse.h"
#include "indextext.h" // for lowercase_term()
#include "mimeparse.h"
@@ -352,7 +353,7 @@ MyHtmlParser::opening_tag(const string &tag)
case 'm':
if (tag == "meta") {
string content;
if (get_parameter("content", content)) {
if (get_parameter(cstr_content, content)) {
string name;
if (get_parameter("name", name)) {
lowercase_term(name);
@@ -386,7 +387,7 @@ MyHtmlParser::opening_tag(const string &tag)
MimeHeaderValue p;
parseMimeHeaderValue(content, p);
map<string, string>::const_iterator k;
if ((k = p.params.find("charset")) !=
if ((k = p.params.find(cstr_charset)) !=
p.params.end()) {
charset = k->second;
if (!samecharset(charset, fromcharset)) {
@@ -517,7 +518,7 @@ MyHtmlParser::closing_tag(const string &tag)
if (tag == "title") {
if (meta.find("title") == meta.end()|| meta["title"].empty()) {
meta["title"] = dump;
dump = "";
dump.clear();
}
break;
}