From: <tw...@us...> - 2005-05-13 11:32:34
|
Update of /cvsroot/synce/rra/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21018 Modified Files: generator.c generator.h recurrence.c Log Message: Patch from Nabil Sayegh to prevent escaping of RRULE contents -- thanks! Index: generator.c =================================================================== RCS file: /cvsroot/synce/rra/lib/generator.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- generator.c 2 May 2004 10:30:21 -0000 1.10 +++ generator.c 13 May 2005 11:32:26 -0000 1.11 @@ -246,6 +246,21 @@ return true; }/*}}}*/ +bool generator_add_simple_unescaped(Generator* self, const char* name, const char* value)/*{{{*/ +{ + if (STATE_IDLE != self->state) + { + synce_error("Missing call to generator_end_line()"); + return false; + } + + strbuf_append(self->buffer, name); + strbuf_append_c(self->buffer, ':'); + strbuf_append(self->buffer, value); + strbuf_append_crlf(self->buffer); + return true; +}/*}}}*/ + bool generator_add_with_type(Generator* self, const char* name, /*{{{*/ const char* type, const char* value) { Index: generator.h =================================================================== RCS file: /cvsroot/synce/rra/lib/generator.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- generator.h 4 Jan 2004 20:22:08 -0000 1.5 +++ generator.h 13 May 2005 11:32:26 -0000 1.6 @@ -31,6 +31,7 @@ bool generator_get_result(Generator* self, char** result); bool generator_add_simple(Generator* self, const char* name, const char* value); +bool generator_add_simple_unescaped(Generator* self, const char* name, const char* value); bool generator_add_with_type(Generator* self, const char* name, const char* type, const char* value); bool generator_add_simple_propval(Generator* self, const char* name, struct _CEPROPVAL* propval); Index: recurrence.c =================================================================== RCS file: /cvsroot/synce/rra/lib/recurrence.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- recurrence.c 22 Apr 2005 12:21:24 -0000 1.25 +++ recurrence.c 13 May 2005 11:32:26 -0000 1.26 @@ -157,7 +157,7 @@ recurrence_append_until_or_count(buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), pattern); - return generator_add_simple(g, "RRULE", buffer); + return generator_add_simple_unescaped(g, "RRULE", buffer); } static bool recurrence_generate_weekly_rrule( @@ -171,7 +171,7 @@ recurrence_append_until_or_count(buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), pattern); recurrence_append_byday (buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), pattern); - return generator_add_simple(g, "RRULE", buffer); + return generator_add_simple_unescaped(g, "RRULE", buffer); } static bool recurrence_generate_monthly_rrule( @@ -184,7 +184,7 @@ recurrence_append_until_or_count(buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), pattern); - return generator_add_simple(g, "RRULE", buffer); + return generator_add_simple_unescaped(g, "RRULE", buffer); } static bool recurrence_generate_monthnth_rrule( @@ -199,7 +199,7 @@ recurrence_append_until_or_count(buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), pattern); recurrence_append_byday (buffer + strlen(buffer), sizeof(buffer) - strlen(buffer), pattern); - return generator_add_simple(g, "RRULE", buffer); + return generator_add_simple_unescaped(g, "RRULE", buffer); } bool recurrence_generate_rrule( |