From 78a7ea5a39ac4a12f106b632dc4cac7c869d21de Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Mon, 23 Mar 2009 13:24:27 -0400 Subject: [PATCH] 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. --- dlls/riched20/reader.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c index 3df7109a0f..fa1ef79c9f 100644 --- a/dlls/riched20/reader.c +++ b/dlls/riched20/reader.c @@ -475,6 +475,11 @@ static void RTFUngetToken(RTF_Info *info) info->pushedMinor = info->rtfMinor; info->pushedParam = info->rtfParam; 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++; }