#include <unistd.h>
#include <curl/curl.h>
#include <curl/curlver.h>
+#include <ctype.h>
#include "account.h"
#include "utils.h"
}
if (rprop && ritr) {
struct icaldurationtype ical_dur;
- struct icaltimetype dtstart, dtend;
+ struct icaltimetype dtstart = icaltime_null_time();
+ struct icaltimetype dtend = icaltime_null_time();
evt = icalcomponent_new_clone(evt);
prop = icalcomponent_get_first_property(evt, ICAL_RRULE_PROPERTY);
if (prop) {
prop = icalcomponent_get_first_property(evt, ICAL_DTSTART_PROPERTY);
if (prop)
dtstart = icalproperty_get_dtstart(prop);
+ else
+ debug_print("event has no DTSTART!\n");
prop = icalcomponent_get_first_property(evt, ICAL_DTEND_PROPERTY);
if (prop)
dtend = icalproperty_get_dtend(prop);
+ else
+ debug_print("event has no DTEND!\n");
ical_dur = icaltime_subtract(dtend, dtstart);
next = icalrecur_iterator_next(ritr);
if (!icaltime_is_null_time(next) &&
strcpy(result+e_len+2, (gchar *)cur->data);
}
}
- slist_free_strings(strs);
- g_slist_free(strs);
+ slist_free_strings_full(strs);
return result;
}
thread_data *td;
#ifdef USE_PTHREAD
pthread_t pt;
- pthread_attr_t pta;
#endif
void *res;
gchar *error = NULL;
STATUSBAR_PUSH(mainwindow_get_mainwindow(), label);
#ifdef USE_PTHREAD
- if (pthread_attr_init(&pta) != 0 ||
- pthread_attr_setdetachstate(&pta, PTHREAD_CREATE_JOINABLE) != 0 ||
- pthread_create(&pt, &pta,
- url_read_thread, td) != 0) {
+ if (pthread_create(&pt, NULL, url_read_thread, td) != 0) {
url_read_thread(td);
}
while (!td->done) {
g_free(error);
return;
}
- if (strncmp(feed, "BEGIN:VCALENDAR", strlen("BEGIN:VCALENDAR"))) {
+
+ gchar *tmp = feed;
+ while (*tmp && isspace((unsigned char)*tmp))
+ tmp++;
+
+ if (strncmp(tmp, "BEGIN:VCALENDAR", strlen("BEGIN:VCALENDAR"))) {
gchar *err_msg = _("This URL does not look like a Webcal URL:\n%s\n%s");
if (verbose && manual_update) {
gchar *uri = NULL;
gchar *tmp = NULL;
- tmp = input_dialog(_("Subscribe to Webcal"), _("Enter the WebCal URL:"), NULL);
+ tmp = input_dialog(_("Subscribe to Webcal"), _("Enter the Webcal URL:"), NULL);
if (tmp == NULL)
return;
message = g_strdup_printf
(_("Do you really want to unsubscribe?"));
avalue = alertpanel_full(_("Delete subscription"), message,
- GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL,
- FALSE, NULL, ALERT_WARNING, G_ALERTDEFAULT);
+ GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, ALERTFOCUS_FIRST,
+ FALSE, NULL, ALERT_WARNING);
g_free(message);
if (avalue != G_ALERTALTERNATE) return;