[poppler] Alternate Patch for CharCodeToUnicode.cc,1.3,1.4

Leonard Rosenthol leonardr at pdfsages.com
Fri Jan 20 11:56:28 PST 2006


At 01:54 PM 1/18/2006, Albert Astals Cid wrote:
>poppler/CharCodeToUnicode.cc: Fix check for length that was not
>         having into account that there could be \n or \r in tokens an that
>         those do not have to be took into account. Fixes
>         http://bugs.kde.org/show_bug.cgi?id=120310
>

         In case you weren't aware, I've been keeping Derek 
(Noonberg, Xpdf author) appraised of the changes to the core Xpdf 
codebase that are being made by the Poppler team - so that there 
isn't any duplication of effort.

         I sent this one to Derek and he responded with an alternate 
(simpler) patch:

>That's the hard way to fix it.  Here's a better patch.
>
>- Derek
>
>
>Index: PSTokenizer.cc
>===================================================================
>RCS file: /home/derekn/src/cvs/xpdf/PSTokenizer.cc,v
>retrieving revision 1.4
>diff -c -r1.4 PSTokenizer.cc
>*** PSTokenizer.cc      20 Mar 2003 23:37:00 -0000      1.4
>--- PSTokenizer.cc      20 Jan 2006 19:13:21 -0000
>***************
>*** 95,101 ****
>     } else if (c == '<') {
>       while ((c = lookChar()) != EOF) {
>         getChar();
>!       if (i < size - 1) {
>         buf[i++] = c;
>         }
>         if (c == '>') {
>--- 95,101 ----
>     } else if (c == '<') {
>       while ((c = lookChar()) != EOF) {
>         getChar();
>!       if (i < size - 1 && specialChars[c] != 1) {
>         buf[i++] = c;
>         }
>         if (c == '>') {


         Enjoy!


Leonard

---------------------------------------------------------------------------
Leonard Rosenthol                            <mailto:leonardr at pdfsages.com>
Chief Technical Officer                      <http://www.pdfsages.com>
PDF Sages, Inc.                              215-938-7080 (voice)
                                              215-938-0880 (fax)



More information about the poppler mailing list