@@ -248,7 +248,8 @@ CString MeaXMLParserHandler::GetFilePathname()
248248// *************************************************************************
249249
250250
251- LPCTSTR MeaXMLParser::m_homeURL = _T(" https://www.cthing.com/" );
251+ CString MeaXMLParser::m_homeURL1 (_T(" https://www.cthing.com/" ));
252+ CString MeaXMLParser::m_homeURL2 (_T(" http://www.cthing.com/" ));
252253
253254
254255MeaXMLParser::MeaXMLParser (MeaXMLParserHandler *handler, bool buildDOM) :
@@ -427,12 +428,19 @@ int MeaXMLParser::ExternalEntityRefHandler(XML_Parser parser,
427428 MeaXMLParser *ps = reinterpret_cast <MeaXMLParser*>(parser);
428429 CString sysId (FromUTF8 (systemId));
429430
430- if (sysId.Find (MeaXMLParser::m_homeURL) == 0 ) {
431+ int homeURLPos = sysId.Find (MeaXMLParser::m_homeURL1);
432+ int homeURLLen = MeaXMLParser::m_homeURL1.GetLength ();
433+ if (homeURLPos < 0 ) {
434+ homeURLPos = sysId.Find (MeaXMLParser::m_homeURL2);
435+ homeURLLen = MeaXMLParser::m_homeURL2.GetLength ();
436+ }
437+
438+ if (homeURLPos == 0 ) {
431439 TCHAR pathname[_MAX_PATH], drive[_MAX_DRIVE], dir[_MAX_DIR];
432440 GetModuleFileName (NULL , pathname, _MAX_PATH);
433441 _tsplitpath_s (pathname, drive, _MAX_DRIVE, dir, _MAX_DIR, NULL , 0 , NULL , 0 );
434442
435- sysId = CString (drive) + CString (dir) + sysId.Mid (static_cast < int >( _tcslen (MeaXMLParser::m_homeURL)) );
443+ sysId = CString (drive) + CString (dir) + sysId.Mid (homeURLLen );
436444 sysId.Replace (_T (' /' ), _T (' \\ ' ));
437445
438446 ps->m_pathnameStack ->push (sysId);
0 commit comments