From 55753d9009e926684aa021762c87de1fdc869fb0 Mon Sep 17 00:00:00 2001 From: Victor Wagner Date: Tue, 17 Oct 2006 18:21:53 +0000 Subject: [PATCH] Fix bug #2 - process some escape sequences properly, when skipping alternates to unicode characters --- src/rtfread.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/rtfread.c b/src/rtfread.c index 8ed1be6..9cb869b 100644 --- a/src/rtfread.c +++ b/src/rtfread.c @@ -261,8 +261,23 @@ int parse_rtf(FILE *f) { if (data_skip_mode == 0) add_to_buffer(&bufptr,com.numarg); i=groups[group_count].uc; - while((--i)>0) - fgetc(f); + while((--i)>0) { + int c=fgetc(f); + if (c == '\\') { + c = fgetc(f); + switch (c) { + case '\\': break; + case '\'': + /* skip two hex digits */ + fgetc(f); + fgetc(f); + break; + default: + break; + } + } + } + break; case RTF_PARA: /*if (para_mode > 0) {*/ -- 2.39.5