From 5ad24b1470eeb5a0a777bad9579f5baad746496c Mon Sep 17 00:00:00 2001 From: Nick Gammon Date: Fri, 13 Feb 2015 07:24:33 +1100 Subject: [PATCH] Allow for newline entity in MXP sequence --- mxp/mxpEntities.cpp | 9 +++++++-- mxp/mxp_phases.cpp | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mxp/mxpEntities.cpp b/mxp/mxpEntities.cpp index 27004e53..210e0b38 100644 --- a/mxp/mxpEntities.cpp +++ b/mxp/mxpEntities.cpp @@ -47,7 +47,12 @@ void CMUSHclientDoc::MXP_collected_entity (void) CString strEntityContents = MXP_GetEntity (m_strMXPstring); if (!strEntityContents.IsEmpty ()) - AddToLine (strEntityContents, 0); + { +// if the entity happens to be < & > etc. don't reprocess it + m_bMXP = false; + DisplayMsg (strEntityContents, strEntityContents.GetLength (), 0); + m_bMXP = true; + } } // end of CMUSHclientDoc::MXP_collected_entity @@ -109,7 +114,7 @@ CString strEntityContents; iResult *= 10; iResult += strName [i] - '0'; } - if (iResult != 9 && iResult != 10 ) // we will accept tabs and newlines ;) + if (iResult != 9 && iResult != 10 && iResult != 13 ) // we will accept tabs, newlines and carriage-returns ;) if (iResult < 32 || // don't allow nonprintable characters iResult > 255) // don't allow characters more than 1 byte { diff --git a/mxp/mxp_phases.cpp b/mxp/mxp_phases.cpp index fa1fac70..85b6d5c5 100644 --- a/mxp/mxp_phases.cpp +++ b/mxp/mxp_phases.cpp @@ -82,8 +82,8 @@ void CMUSHclientDoc::Phase_MXP_ENTITY (const unsigned char c) switch (c) { case ';': - MXP_collected_entity (); // we have an entity now m_phase = NONE; + MXP_collected_entity (); // we have an entity now break; // shouldn't have a & inside a &