X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14eacdd46a0dcb917df05351353525766a773953..c0cc7004a6ec1c53c0fd974898ef9ffd3739bef4:/utils/tex2rtf/src/texutils.cpp diff --git a/utils/tex2rtf/src/texutils.cpp b/utils/tex2rtf/src/texutils.cpp index eead3b6dfc..5bf4838829 100644 --- a/utils/tex2rtf/src/texutils.cpp +++ b/utils/tex2rtf/src/texutils.cpp @@ -29,6 +29,7 @@ #undef new #endif +#include "wx/beforestd.h" #if wxUSE_IOSTREAMH #include #include @@ -37,6 +38,7 @@ #include using namespace std; #endif +#include "wx/afterstd.h" #include #include "tex2any.h" @@ -479,9 +481,9 @@ void BibEatWhiteSpace(wxString& line) } // Ignore end-of-line comments - if (line[0] == _T('%') || line[0] == _T(';') || line[0] == _T('#')) + if ( !line.empty() && (line[0] == _T('%') || line[0] == _T(';') || line[0] == _T('#'))) { - line = wxEmptyString; + line.clear(); } } @@ -569,7 +571,7 @@ wxString BibReadToEOL(wxString& line) val << line[0]; line = line.substr(1); } - if (line[0] == '"') + if (!line.empty() && line[0] == '"') line = line.substr(1); return val;