Changeset 308 for trunk/ext/php/phpext.c

Show
Ignore:
Timestamp:
04/27/2008 08:35:26 (7 months ago)
Author:
indeyets
Message:

multiline strings are exported in folded format, now

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/ext/php/phpext.c

    r303 r308  
    661661 
    662662                case IS_STRING: 
    663                         syck_emit_scalar(e, "str", scalar_2quote, 0, 0, 0, Z_STRVAL_P(data), Z_STRLEN_P(data)); 
     663                { 
     664                        enum scalar_style style = scalar_2quote; 
     665                        const char *ptr; 
     666 
     667                        for (ptr = Z_STRVAL_P(data); ptr != Z_STRVAL_P(data) + Z_STRLEN_P(data); ptr++) { 
     668                                if (*ptr == '\n') { 
     669                                        style = scalar_fold; 
     670                                } 
     671                        } 
     672 
     673                        syck_emit_scalar(e, "str", style, 0, 0, 0, Z_STRVAL_P(data), Z_STRLEN_P(data)); 
     674                } 
    664675                break; 
    665676