From 8ddffc9987fafecfc497efc751281f56b1667856 Mon Sep 17 00:00:00 2001 From: Stas Degteff Date: Sun, 4 Feb 2007 15:42:17 +0000 Subject: [PATCH] Fix token recognition in macro parser --- golded3/gecmfd.cpp | 4 ++-- golded3/gectrl.cpp | 6 +++--- golded3/gemsgs.cpp | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/golded3/gecmfd.cpp b/golded3/gecmfd.cpp index eff080e..fea39ab 100644 --- a/golded3/gecmfd.cpp +++ b/golded3/gecmfd.cpp @@ -199,7 +199,7 @@ void Area::DelMsgs(GMsg* msg, bool force) HeaderView->Paint(); BodyView->Use(AA, msg, topline); BodyView->Paint(); - + switch(MenuDelete.Run(YES, msg)) { case YES: // Yes, delete @@ -428,7 +428,7 @@ void CmfMsgs(GMsg* msg, bool torecycle) else { if (CFG->arearecyclebin[0]) - { + { int areano = AL.AreaEchoToNo(CFG->arearecyclebin); int currno = AL.AreaIdToNo(CurrArea); diff --git a/golded3/gectrl.cpp b/golded3/gectrl.cpp index 2dba8bb..e44b395 100644 --- a/golded3/gectrl.cpp +++ b/golded3/gectrl.cpp @@ -752,11 +752,11 @@ void DoTearorig(int mode, GMsg* msg) { 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(); - 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()); // Delete current tag-, tear- and originlines @@ -801,7 +801,7 @@ void DoTearorig(int mode, GMsg* msg) { MakeOrigin(msg, origin.c_str()); 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); // Add the tagline, tearline and origin as defined diff --git a/golded3/gemsgs.cpp b/golded3/gemsgs.cpp index e9a3d3e..0fa4251 100644 --- a/golded3/gemsgs.cpp +++ b/golded3/gemsgs.cpp @@ -48,8 +48,9 @@ static bool tokenxchg(std::string &input, std::string::iterator &pos, size_t len = 0, size_t cnt = 0, ...) { 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::iterator tokend = pos+toklen;