aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
+ }
}
}