Re: [PATCH]: Fix bug in RTF importer

From: Dom Lachowicz (domlachowicz@yahoo.com)
Date: Tue Jun 24 2003 - 17:23:49 EDT

  • Next message: Gianni Tedesco: "Re: [PATCH]: Fix bug in RTF importer"

    Hi Gianni,

    First, thanks for the patch.

    I haven't tried out your patch against latex2rtf or
    normal RTF documents, so I don't know if I'm talking
    out of my ass here, but...

    > ---
    > abiword-1.99.1/abi/src/wp/impexp/xp/ie_imp_RTF.cpp
    > 2003-06-08 09:43:55.000000000 +0100
    > +++
    >
    abiword-1.99.1-dev/abi/src/wp/impexp/xp/ie_imp_RTF.cpp
    > 2003-06-24 21:44:33.000000000 +0100
    > @@ -7245,10 +7246,11 @@
    > }
    > else
    > {
    > - if ((ch != '{') && (ch != '}')) // don't
    > choke if there is no data (malformed RTF)
    > - { // see bug
    > 1383 and 1384
    > - return false;
    > - }
    > + do
    > + {
    > + if (!ReadCharFromFile(&ch))
    > + return false;
    > + } while (ch != '}' && ch != '{');
    >
    > // multiple entries in font table
    > while (ch != '}')
    >

    Would this not discard the first ch that we've already
    read in, which could potentially be a '}' or '{'
    character? Would a preferable solution be:

    while (ch != '}' && ch != '{') {
     if (!ReadCharFromFile(&ch))
      return false;
    }

    ??

    Thanks again!
    Dom

    __________________________________
    Do you Yahoo!?
    SBC Yahoo! DSL - Now only $29.95 per month!
    http://sbc.yahoo.com



    This archive was generated by hypermail 2.1.4 : Tue Jun 24 2003 - 17:35:00 EDT