From: Andrea C. <ac...@us...> - 2004-09-03 07:46:32
|
Update of /cvsroot/freeassociation/libical/src/libical In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32410 Modified Files: icalproperty.c Log Message: RFC2445 requires lines to be terminated by a CRLF sequence. The Unix roots of libical make many people prefer an LF alone. Make the choice user-configurable by defining ICAL_UNIX_NEWLINE, with the default being RFC conformance. Chances as this default will need to be reviewed before the next release, and configure support evaluated. Submitted by: Mostafa Hosseini <mos...@oe...> Index: icalproperty.c =================================================================== RCS file: /cvsroot/freeassociation/libical/src/libical/icalproperty.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- icalproperty.c 17 Mar 2004 19:06:50 -0000 1.35 +++ icalproperty.c 3 Sep 2004 07:46:10 -0000 1.36 @@ -196,13 +196,19 @@ icalcomponent *comp; int errors = 0; +#ifdef ICAL_UNIX_NEWLINE + char newline[] = "\n"; +#else + char newline[] = "\r\n"; +#endif + icalerror_check_arg_rz( (str!=0),"str"); /* Is this a HACK or a crafty reuse of code? */ icalmemory_append_string(&buf, &buf_ptr, &buf_size, "BEGIN:VCALENDAR\n"); icalmemory_append_string(&buf, &buf_ptr, &buf_size, str); - icalmemory_append_string(&buf, &buf_ptr, &buf_size, "\n"); + icalmemory_append_string(&buf, &buf_ptr, &buf_size, newline); icalmemory_append_string(&buf, &buf_ptr, &buf_size, "END:VCALENDAR\n"); comp = icalparser_parse_string(buf); @@ -450,7 +456,12 @@ char *out_buf; const char* kind_string = 0; +#ifdef ICAL_UNIX_NEWLINE char newline[] = "\n"; +#else + char newline[] = "\r\n"; +#endif + icalerror_check_arg_rz( (prop!=0),"prop"); |