summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKent Sutherland <git@ksuther.com>2013-11-13 00:03:14 -0500
committerKent Sutherland <git@ksuther.com>2014-06-02 19:53:37 -0700
commit61c6be8a076d0383281de267525728f4ef2cb0dd (patch)
tree588cfb983e0a5d93790c51c1346b67dbc7369214 /src
parent0c17535f536b9277f849198a30d6f11f48b20316 (diff)
downloadlibical-git-61c6be8a076d0383281de267525728f4ef2cb0dd.tar.gz
Adding a workaround for X-APPLE-STRUCTURED-LOCATION, which uses a comma to separate latitude and longitude. Normally this will split the property into two properties, but we want to keep it as one property in this case.
Diffstat (limited to 'src')
-rw-r--r--src/libical/icalparser.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libical/icalparser.c b/src/libical/icalparser.c
index 43ea9035..8eb0f4e7 100644
--- a/src/libical/icalparser.c
+++ b/src/libical/icalparser.c
@@ -1093,6 +1093,18 @@ icalcomponent* icalparser_add_line(icalparser* parser,
*/
switch (prop_kind) {
case ICAL_X_PROPERTY:
+ /* Apple's geofence property uses a comma to separate latitude and longitude.
+ libical will normally try to split this into two separate values,
+ but in this case we need to treat it as a single value.
+ */
+ if (strncmp(icalproperty_get_x_name(prop), "X-APPLE-STRUCTURED-LOCATION", 27) == 0) {
+ str = icalparser_get_value(end, &end, value_kind);
+ } else {
+ str = parser_get_next_value(end,&end, value_kind);
+ }
+
+ strstriplt (str);
+ break;
case ICAL_CATEGORIES_PROPERTY:
case ICAL_RESOURCES_PROPERTY:
/* Referring to RFC 2445, section 4.8.5.3 and section 4.8.5.1: