Fixed bug 254356: incorrect line endings

Undefined ICAL_UNIX_NEWLINE which doesn't comply with rfc2445
Imported fix from libical.cvs to icalpropery.c
This commit is contained in:
mostafah%oeone.com 2004-09-07 16:12:29 +00:00
Родитель 7a3ae84566
Коммит a013cd3d65
2 изменённых файлов: 13 добавлений и 3 удалений

Просмотреть файл

@ -25,7 +25,7 @@
#define ICAL_SAFESAVES 1
/* Define to terminate lines with "\n" instead of "\r\n" */
#define ICAL_UNIX_NEWLINE 1
/* #undef ICAL_UNIX_NEWLINE */
/* Define to 1 if you DO NOT WANT to see deprecated messages */
#define NO_WARN_DEPRECATED 1

Просмотреть файл

@ -4,7 +4,7 @@
FILE: icalproperty.c
CREATOR: eric 28 April 1999
$Id: icalproperty.c,v 1.4 2002-03-14 15:17:52 mikep%oeone.com Exp $
$Id: icalproperty.c,v 1.5 2004-09-07 16:12:29 mostafah%oeone.com Exp $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@ -187,13 +187,19 @@ icalproperty* icalproperty_new_from_string(const char* str)
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);
@ -286,7 +292,11 @@ icalproperty_as_ical_string (icalproperty* prop)
icalvalue* value;
char *out_buf;
#ifdef ICAL_UNIX_NEWLINE
char newline[] = "\n";
#else
char newline[] = "\r\n";
#endif
struct icalproperty_impl *impl = (struct icalproperty_impl*)prop;