Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Wrong processing of double-quoted strings

Oleg Repin
2008-12-21
2013-05-29
  • Oleg Repin
    Oleg Repin
    2008-12-21

    I recommend to replace the following code of parseCommaDelimitString():

            if ( pathNames &&
                 (srcptr[0]     == '"') &&
                 (srcptr[len-1] == '"') ) {
                srcptr[len-1] = 0;
                len -= 2;
                srcptr++;
            }
            parsed_strings.Add( srcptr, (int)len + 1 );

    to this:

            if ( pathNames &&
                 (srcptr[0]     == '"') &&
                 (srcptr[len-1] == '"') ) {
                srcptr[len-1] = 0;
                parsed_strings.Add( srcptr + 1, (int)len - 1 );
            }
            else
                parsed_strings.Add( srcptr, (int)len + 1 );

    Regards,
    --
    Oleg