fix nasty html parse bug introduced in 1.0.9

This commit is contained in:
dockes 2005-12-06 08:35:48 +00:00
parent 7f76993209
commit d2b54d6af2
4 changed files with 11 additions and 8 deletions

View File

@ -1 +1 @@
1.0.11
1.0.12

View File

@ -1,5 +1,5 @@
#ifndef lint
static char rcsid[] = "@(#$Id: internfile.cpp,v 1.11 2005-11-24 07:16:15 dockes Exp $ (C) 2004 J.F.Dockes";
static char rcsid[] = "@(#$Id: internfile.cpp,v 1.12 2005-12-06 08:35:48 dockes Exp $ (C) 2004 J.F.Dockes";
#endif
#include <unistd.h>
#include <sys/types.h>
@ -161,7 +161,9 @@ FileInterner::Status FileInterner::internfile(Rcl::Doc& doc, string& ipath)
m_handler->mkDoc(m_cfg, m_fn, m_mime, doc, ipath);
FileInterner::Status ret = FIError;
switch (mhs) {
case MimeHandler::MHError: break;
case MimeHandler::MHError:
LOGERR(("FileInterner::internfile: error parsing %s\n", m_fn.c_str()));
break;
case MimeHandler::MHDone: ret = FIDone;break;
case MimeHandler::MHAgain: ret = FIAgain;break;
}

View File

@ -108,8 +108,10 @@ MimeHandlerHtml::mkDoc(RclConfig *conf, const string &,
LOGDEB(("textHtmlToDoc: charset '%s' doc charset '%s',"
"reparse\n", charset.c_str(),pres.doccharset.c_str()));
charset = pres.doccharset;
} else
break;
} else {
LOGERR(("textHtmlToDoc:: error: non charset exception\n"));
return MimeHandler::MHError;
}
}
}

View File

@ -24,10 +24,9 @@
#include <stdio.h>
#include "myhtmlparse.h"
#include "indextext.h" // for lowercase_term()
#include "mimeparse.h"
#include "smallut.h"
// The original version for this compresses whitespace and suppresses newlines
// I can see no good reason to do this, and it actually helps preview to keep
@ -171,7 +170,7 @@ MyHtmlParser::opening_tag(const string &tag, const map<string,string> &p)
if ((k = p.params.find("charset")) !=
p.params.end()) {
doccharset = k->second;
if (doccharset != ocharset) {
if (!samecharset(doccharset, ocharset)) {
LOGDEB1(("Doc specified charset '%s' "
"differs from announced '%s'\n",
doccharset.c_str(),