]> wagner.pp.ru Git - oss/catdoc.git/commitdiff
Fix bug #2 - process some escape sequences properly, when skipping
authorVictor Wagner <vitus@wagner.pp.ru>
Tue, 17 Oct 2006 18:21:53 +0000 (18:21 +0000)
committerVictor Wagner <vitus@wagner.pp.ru>
Tue, 17 Oct 2006 18:21:53 +0000 (18:21 +0000)
alternates to unicode characters

src/rtfread.c

index 8ed1be68c78bf0634c2690241bc7886772d35c74..9cb869b05a551c0b012af178c97e7d39c869aba4 100644 (file)
@@ -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) {*/