diff options
author | Seth Alves <alves@src.gnome.org> | 2000-04-25 04:01:44 +0800 |
---|---|---|
committer | Seth Alves <alves@src.gnome.org> | 2000-04-25 04:01:44 +0800 |
commit | 33f48d299ea754aa6679a092ad820e8c96a020f6 (patch) | |
tree | 64c0bb75a340a59ed485bf13761149ced216f8da /calendar/cal-util/icalendar.c | |
parent | d38dcd1631a6017598a78f7cc82a48b50753a911 (diff) | |
download | gsoc2013-evolution-33f48d299ea754aa6679a092ad820e8c96a020f6.tar gsoc2013-evolution-33f48d299ea754aa6679a092ad820e8c96a020f6.tar.gz gsoc2013-evolution-33f48d299ea754aa6679a092ad820e8c96a020f6.tar.bz2 gsoc2013-evolution-33f48d299ea754aa6679a092ad820e8c96a020f6.tar.lz gsoc2013-evolution-33f48d299ea754aa6679a092ad820e8c96a020f6.tar.xz gsoc2013-evolution-33f48d299ea754aa6679a092ad820e8c96a020f6.tar.zst gsoc2013-evolution-33f48d299ea754aa6679a092ad820e8c96a020f6.zip |
allow for null CN (parse_person): allow for null sent_by
* pcs/icalendar.c (parse_person): allow for null CN
(parse_person): allow for null sent_by
* pcs/Makefile.am: build icalendar-test
* pcs/icalendar-test.c: a test which loads an ical file and
converts it to our internal format, and then saves it back out.
svn path=/trunk/; revision=2588
Diffstat (limited to 'calendar/cal-util/icalendar.c')
-rw-r--r-- | calendar/cal-util/icalendar.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/calendar/cal-util/icalendar.c b/calendar/cal-util/icalendar.c index 8a15bb3cb4..eedb732617 100644 --- a/calendar/cal-util/icalendar.c +++ b/calendar/cal-util/icalendar.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * icalendar server for gnomecal * @@ -195,8 +196,8 @@ ical_object_create_from_icalcomponent (icalcomponent* comp) ical->dtend = icaltime_to_timet (&ictime); param = icalproperty_get_first_parameter (prop, ICAL_VALUE_PARAMETER); - ical->date_only = (icalparameter_get_value (param) == - ICAL_VALUE_DATE); + if (param) + ical->date_only = (icalparameter_get_value (param) == ICAL_VALUE_DATE); /* FIXME: We should handle timezone specifiers */ break; case ICAL_DUE_PROPERTY: @@ -213,8 +214,8 @@ ical_object_create_from_icalcomponent (icalcomponent* comp) ical->dtstart = icaltime_to_timet (&ictime); param = icalproperty_get_first_parameter (prop, ICAL_VALUE_PARAMETER); - ical->date_only = (icalparameter_get_value (param) == - ICAL_VALUE_DATE); + if (param) + ical->date_only = (icalparameter_get_value (param) == ICAL_VALUE_DATE); /* FIXME: We should handle timezone specifiers */ break; case ICAL_DURATION_PROPERTY: @@ -414,7 +415,11 @@ parse_person (icalproperty* prop, gchar* value) param = icalproperty_get_first_parameter (prop, ICAL_CN_PARAMETER); - ret->name = g_strdup (icalparameter_get_cn (param)); + if (param) + ret->name = g_strdup (icalparameter_get_cn (param)); + else + ret->name = NULL; + param = icalproperty_get_first_parameter (prop, ICAL_ROLE_PARAMETER); @@ -532,10 +537,11 @@ parse_person (icalproperty* prop, gchar* value) ICAL_DELEGATEDFROM_PARAMETER); } - param = icalproperty_get_first_parameter (prop, ICAL_SENTBY_PARAMETER -); - copy_str (&ret->sent_by, - icalparameter_get_sentby (param)); + param = icalproperty_get_first_parameter (prop, ICAL_SENTBY_PARAMETER); + if (param) + copy_str (&ret->sent_by, icalparameter_get_sentby (param)); + else + ret->sent_by = NULL; param = icalproperty_get_first_parameter (prop, ICAL_DIR_PARAMETER); while (param) { |