diff options
author | Rodrigo Moya <rodrigo@novell.com> | 2005-02-02 20:29:26 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@src.gnome.org> | 2005-02-02 20:29:26 +0800 |
commit | 7580e2fa47f92502a9ec207562d449b2f685b028 (patch) | |
tree | 4cb87012a3a301b6c3b51488b43bd3765ec4adf7 /calendar/gui | |
parent | 03d6657b97a417b22d8cc1ff544dd3ddec7e619b (diff) | |
download | gsoc2013-evolution-7580e2fa47f92502a9ec207562d449b2f685b028.tar.gz gsoc2013-evolution-7580e2fa47f92502a9ec207562d449b2f685b028.tar.zst gsoc2013-evolution-7580e2fa47f92502a9ec207562d449b2f685b028.zip |
Fixes #72090
2005-02-02 Rodrigo Moya <rodrigo@novell.com>
Fixes #72090
* gui/calendar-component.c (impl_handleURI): don't assume the URI is
always correct.
svn path=/trunk/; revision=28677
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/calendar-component.c | 64 |
1 files changed, 33 insertions, 31 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 81de5e1e95..2f641bcd4b 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -635,48 +635,50 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme time_t start = -1, end = -1; p = euri->query; - while (*p) { - len = strcspn (p, "=&"); + if (p) { + while (*p) { + len = strcspn (p, "=&"); - /* If it's malformed, give up. */ - if (p[len] != '=') - break; + /* If it's malformed, give up. */ + if (p[len] != '=') + break; - header = (char *) p; - header[len] = '\0'; - p += len + 1; + header = (char *) p; + header[len] = '\0'; + p += len + 1; - clen = strcspn (p, "&"); + clen = strcspn (p, "&"); - content = g_strndup (p, clen); + content = g_strndup (p, clen); - if (!g_ascii_strcasecmp (header, "startdate")) { - start = time_from_isodate (content); - } else if (!g_ascii_strcasecmp (header, "enddate")) { - end = time_from_isodate (content); - } - - g_free (content); + if (!g_ascii_strcasecmp (header, "startdate")) { + start = time_from_isodate (content); + } else if (!g_ascii_strcasecmp (header, "enddate")) { + end = time_from_isodate (content); + } - p += clen; - if (*p == '&') { - p++; - if (!strcmp (p, "amp;")) - p += 4; + g_free (content); + + p += clen; + if (*p == '&') { + p++; + if (!strcmp (p, "amp;")) + p += 4; + } } - } - if (start != -1) { - GList *l; + if (start != -1) { + GList *l; - if (end == -1) - end = start; + if (end == -1) + end = start; - l = g_list_last (priv->views); - if (l) { - CalendarComponentView *view = l->data; + l = g_list_last (priv->views); + if (l) { + CalendarComponentView *view = l->data; - gnome_calendar_set_selected_time_range (view->calendar, start, end); + gnome_calendar_set_selected_time_range (view->calendar, start, end); + } } } |