* Do not close a nesting level twice after close() has been

called explicitly on a Nest object.
This commit is contained in:
Eelco Dolstra 2004-03-27 15:33:19 +00:00
parent 7823db2137
commit f0f7a9f299
2 changed files with 11 additions and 1 deletions

View file

@ -279,6 +279,7 @@ void Nest::close()
nestingLevel--;
if (logType == ltEscapes)
cerr << "\033[q";
nest = false;
}
}

View file

@ -16,6 +16,7 @@ struct Decoder
bool newNumber;
int priority;
bool ignoreLF;
int lineNo, charNo;
Decoder()
{
@ -25,6 +26,8 @@ struct Decoder
level = 0;
priority = 1;
ignoreLF = false;
lineNo = 1;
charNo = 0;
}
void pushChar(char c);
@ -35,6 +38,11 @@ struct Decoder
void Decoder::pushChar(char c)
{
if (c == '\n') {
lineNo++;
charNo = 0;
} else charNo++;
switch (state) {
case stTop:
@ -71,7 +79,8 @@ void Decoder::pushChar(char c)
level--;
cout << "</nest>" << endl;
} else
cerr << "not enough nesting levels" << endl;
cerr << "not enough nesting levels at line "
<< lineNo << ", character " << charNo << endl;
break;
case 's':
if (line.size()) finishLine();