aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@novell.com>2005-02-02 20:29:26 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2005-02-02 20:29:26 +0800
commit7580e2fa47f92502a9ec207562d449b2f685b028 (patch)
tree4cb87012a3a301b6c3b51488b43bd3765ec4adf7
parent03d6657b97a417b22d8cc1ff544dd3ddec7e619b (diff)
downloadgsoc2013-evolution-7580e2fa47f92502a9ec207562d449b2f685b028.tar
gsoc2013-evolution-7580e2fa47f92502a9ec207562d449b2f685b028.tar.gz
gsoc2013-evolution-7580e2fa47f92502a9ec207562d449b2f685b028.tar.bz2
gsoc2013-evolution-7580e2fa47f92502a9ec207562d449b2f685b028.tar.lz
gsoc2013-evolution-7580e2fa47f92502a9ec207562d449b2f685b028.tar.xz
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
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/calendar-component.c64
2 files changed, 40 insertions, 31 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index bc676f7cb8..72355b96cc 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+2005-02-02 Rodrigo Moya <rodrigo@novell.com>
+
+ Fixes #72090
+
+ * gui/calendar-component.c (impl_handleURI): don't assume the URI is
+ always correct.
+
2005-02-01 Rodney Dawes <dobey@novell.com>
* gui/dialogs/comp-editor.c (setup_widgets): Clean up the spacing
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);
+ }
}
}