mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-02-18 10:01:48 +00:00
Fixed, text parsers: the parser could stuck in infinite loop when trying to skip an unclosed block comment.
This commit is contained in:
parent
03265d7d5d
commit
54bf4afdff
1 changed files with 3 additions and 1 deletions
|
@ -146,6 +146,7 @@ namespace CodeImp.DoomBuilder.ZDoom
|
||||||
{
|
{
|
||||||
int offset = skipnewline ? 0 : 1;
|
int offset = skipnewline ? 0 : 1;
|
||||||
char c;
|
char c;
|
||||||
|
prevstreamposition = datastream.Position; //mxd
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
@ -179,13 +180,14 @@ namespace CodeImp.DoomBuilder.ZDoom
|
||||||
{
|
{
|
||||||
// Skip until */
|
// Skip until */
|
||||||
char c4, c3 = '\0';
|
char c4, c3 = '\0';
|
||||||
|
prevstreamposition = datastream.Position; //mxd
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
if(datastream.Position == datastream.Length) //mxd
|
if(datastream.Position == datastream.Length) //mxd
|
||||||
{
|
{
|
||||||
// ZDoom doesn't give even a warning message about this, so we shouldn't report error or fail parsing.
|
// ZDoom doesn't give even a warning message about this, so we shouldn't report error or fail parsing.
|
||||||
General.ErrorLogger.Add(ErrorType.Warning, "DECORATE warning in '" + sourcename + "', line " + GetCurrentLineNumber() + ". Block comment is not closed.");
|
General.ErrorLogger.Add(ErrorType.Warning, "DECORATE warning in '" + sourcename + "', line " + GetCurrentLineNumber() + ". Block comment is not closed.");
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
c4 = c3;
|
c4 = c3;
|
||||||
|
|
Loading…
Reference in a new issue