Fix token recognition in macro parser

This commit is contained in:
Stas Degteff 2007-02-04 15:42:17 +00:00
parent 497bf8d0c9
commit 8ddffc9987
3 changed files with 7 additions and 6 deletions

View File

@ -752,11 +752,11 @@ void DoTearorig(int mode, GMsg* msg) {
strbtrim(msg->tagline); strbtrim(msg->tagline);
} }
TokenXlat(mode, msg->tearline, sizeof(msg->tearline), msg, msg, CurrArea); TokenXlat(mode, msg->tearline, sizeof(msg->tearline), msg, msg, CurrArea); // tearline translation one point
ctrlinfo = AA->Ctrlinfo(); ctrlinfo = AA->Ctrlinfo();
if(not *msg->origin) if(not *msg->origin) // Strange... Origin is created here, but deleted in in next block. To be fixed?
MakeOrigin(msg, origin.c_str()); MakeOrigin(msg, origin.c_str());
// Delete current tag-, tear- and originlines // Delete current tag-, tear- and originlines
@ -801,7 +801,7 @@ void DoTearorig(int mode, GMsg* msg) {
MakeOrigin(msg, origin.c_str()); MakeOrigin(msg, origin.c_str());
TokenXlat(mode, msg->tagline, sizeof(msg->tagline), msg, msg, CurrArea); TokenXlat(mode, msg->tagline, sizeof(msg->tagline), msg, msg, CurrArea);
TokenXlat(mode, msg->tearline, sizeof(msg->tearline), msg, msg, CurrArea); TokenXlat(mode, msg->tearline, sizeof(msg->tearline), msg, msg, CurrArea); // tearline translation two point
TokenXlat(mode, msg->origin, sizeof(msg->origin), msg, msg, CurrArea); TokenXlat(mode, msg->origin, sizeof(msg->origin), msg, msg, CurrArea);
// Add the tagline, tearline and origin as defined // Add the tagline, tearline and origin as defined

View File

@ -48,8 +48,9 @@ static bool tokenxchg(std::string &input, std::string::iterator &pos,
size_t len = 0, size_t cnt = 0, ...) size_t len = 0, size_t cnt = 0, ...)
{ {
size_t toklen = strlen(tok); size_t toklen = strlen(tok);
const char* inp_str_tok=it2str(input, pos);
if (strnieql(it2str(input, pos), tok, toklen)) if ( (strnieql(inp_str_tok, tok, toklen)) && isspace(inp_str_tok[toklen]) )
{ {
std::string str = src; std::string str = src;
std::string::iterator tokend = pos+toklen; std::string::iterator tokend = pos+toklen;