Annotation of pkgsrc/textproc/tinyxml/patches/patch-tinyxml.cpp, revision 1.1

1.1     ! wiz         1: $NetBSD$
        !             2: 
        !             3: Fix entity encoding. From
        !             4: http://sourceforge.net/p/tinyxml/patches/51/
        !             5: 
        !             6: --- tinyxml.cpp.orig   2011-05-15 02:24:57.000000000 +0000
        !             7: +++ tinyxml.cpp
        !             8: @@ -57,30 +57,7 @@ void TiXmlBase::EncodeString( const TIXM
        !             9:        {
        !            10:                unsigned char c = (unsigned char) str[i];
        !            11:  
        !            12: -              if (    c == '&' 
        !            13: -                   && i < ( (int)str.length() - 2 )
        !            14: -                       && str[i+1] == '#'
        !            15: -                       && str[i+2] == 'x' )
        !            16: -              {
        !            17: -                      // Hexadecimal character reference.
        !            18: -                      // Pass through unchanged.
        !            19: -                      // &#xA9;       -- copyright symbol, for example.
        !            20: -                      //
        !            21: -                      // The -1 is a bug fix from Rob Laveaux. It keeps
        !            22: -                      // an overflow from happening if there is no ';'.
        !            23: -                      // There are actually 2 ways to exit this loop -
        !            24: -                      // while fails (error case) and break (semicolon found).
        !            25: -                      // However, there is no mechanism (currently) for
        !            26: -                      // this function to return an error.
        !            27: -                      while ( i<(int)str.length()-1 )
        !            28: -                      {
        !            29: -                              outString->append( str.c_str() + i, 1 );
        !            30: -                              ++i;
        !            31: -                              if ( str[i] == ';' )
        !            32: -                                      break;
        !            33: -                      }
        !            34: -              }
        !            35: -              else if ( c == '&' )
        !            36: +              if ( c == '&' )
        !            37:                {
        !            38:                        outString->append( entity[0].str, entity[0].strLength );
        !            39:                        ++i;

CVSweb <webmaster@jp.NetBSD.org>