From 77a394e24d85bbaceed4e5e656d63b07b8f420e3 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Wed, 25 Jul 2001 18:46:43 +0000 Subject: if the property contai 2001-07-25 JP Rosevear * src/libical/icalparameter.c (icalparameter_as_ical_string): if the property contai svn path=/trunk/; revision=11405 --- libical/ChangeLog | 6 ++++++ libical/src/libical/icalparameter.c | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/libical/ChangeLog b/libical/ChangeLog index f26bdb1448..70c28eb878 100644 --- a/libical/ChangeLog +++ b/libical/ChangeLog @@ -1,3 +1,9 @@ +2001-07-25 JP Rosevear + + * src/libical/icalparameter.c (icalparameter_as_ical_string): if + the property contains ':' or ';' put the value in quotes so it + parses correctly + 2001-07-23 JP Rosevear * src/libical/icalparser.c: pass extra param to diff --git a/libical/src/libical/icalparameter.c b/libical/src/libical/icalparameter.c index 156ecdb04b..7e0d15cef3 100644 --- a/libical/src/libical/icalparameter.c +++ b/libical/src/libical/icalparameter.c @@ -245,7 +245,17 @@ icalparameter_as_ical_string (icalparameter* parameter) icalmemory_append_string(&buf, &buf_ptr, &buf_size, "="); if(impl->string !=0){ + int qm = 0; + + /* Encapsulate the property in quotes if necessary */ + if (strchr (impl->string, ';') != 0 || strchr (impl->string, ':') != 0) { + icalmemory_append_char (&buf, &buf_ptr, &buf_size, '"'); + qm = 1; + } icalmemory_append_string(&buf, &buf_ptr, &buf_size, impl->string); + if (qm == 1) { + icalmemory_append_char (&buf, &buf_ptr, &buf_size, '"'); + } } else if (impl->data != 0){ const char* str = icalparameter_enum_to_string(impl->data); icalmemory_append_string(&buf, &buf_ptr, &buf_size, str); -- cgit