richedit: Properly handle lack of semicolon after font name in rtf.
This was partially handled by ungetting the end group token (i.e. '}') so that it was read again at the proper place. Unfortunately there is a read hook that maintains a stackTop variable, which is decremented when receiving this end group token. Therefore stackTop would get decremented twice, and the rich text file would end prematurely. This is fixed by incrementing the stackTop variable to compensate for it being decremented twice.
This commit is contained in:
parent
2592fea305
commit
78a7ea5a39
|
@ -475,6 +475,11 @@ static void RTFUngetToken(RTF_Info *info)
|
||||||
info->pushedMinor = info->rtfMinor;
|
info->pushedMinor = info->rtfMinor;
|
||||||
info->pushedParam = info->rtfParam;
|
info->pushedParam = info->rtfParam;
|
||||||
lstrcpyA (info->pushedTextBuf, info->rtfTextBuf);
|
lstrcpyA (info->pushedTextBuf, info->rtfTextBuf);
|
||||||
|
/* The read hook decrements stackTop on rtfEndGroup, so
|
||||||
|
* increment the value to compensate for it being decremented
|
||||||
|
* twice due to the RTFUngetToken. */
|
||||||
|
if(RTFCheckCM (info, rtfGroup, rtfEndGroup))
|
||||||
|
info->stackTop++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue