Module: wine
Branch: master
Commit: 78a7ea5a39ac4a12f106b632dc4cac7c869d21de
URL: http://source.winehq.org/git/wine.git/?a=commit;h=78a7ea5a39ac4a12f106b632d…
Author: Dylan Smith <dylan.ah.smith(a)gmail.com>
Date: Mon Mar 23 13:24:27 2009 -0400
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 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/dlls/riched20/reader.c b/dlls/riched20/reader.c
index 3df7109..fa1ef79 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++;
}