Commit 5c017522 authored by Krzysztof Foltman's avatar Krzysztof Foltman Committed by Alexandre Julliard

- Single quotes are now handled properly (previously they were

inserted as [[']]). - Better handling of callback function's results.
parent 31375666
...@@ -95,7 +95,7 @@ int ansi_gen[] = ...@@ -95,7 +95,7 @@ int ansi_gen[] =
rtfSC_dollar ,'$', rtfSC_dollar ,'$',
rtfSC_percent ,'%', rtfSC_percent ,'%',
rtfSC_ampersand ,'&', rtfSC_ampersand ,'&',
rtfSC_quoteright ,'\\', rtfSC_quoteright ,'\'',
rtfSC_parenleft ,'(', rtfSC_parenleft ,'(',
rtfSC_parenright ,')', rtfSC_parenright ,')',
rtfSC_asterisk ,'*', rtfSC_asterisk ,'*',
...@@ -936,11 +936,19 @@ int _RTFGetChar(RTF_Info *info) ...@@ -936,11 +936,19 @@ int _RTFGetChar(RTF_Info *info)
TRACE("\n"); TRACE("\n");
if (info->dwInputSize <= info->dwInputUsed) /* if the last buffer wasn't full, it's EOF */
if (info->dwInputSize > 0 &&
info->dwInputSize == info->dwInputUsed && info->dwInputSize < sizeof(info->InputBuffer))
return EOF;
if (info->dwInputSize <= info->dwInputUsed)
{ {
long count = 0; long count = 0;
info->editstream.pfnCallback(info->editstream.dwCookie, info->editstream.dwError = info->editstream.pfnCallback(info->editstream.dwCookie,
info->InputBuffer, sizeof(info->InputBuffer), &count); info->InputBuffer, sizeof(info->InputBuffer), &count);
/* if error, it's EOF */
if (info->editstream.dwError)
return EOF;
/* if no bytes read, it's EOF */
if(count == 0) if(count == 0)
return EOF; return EOF;
info->dwInputSize = count; info->dwInputSize = count;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment