Real fix for Coverity 1372362.
[claws.git] / src / plugins / vcalendar / vcal_folder.c
index af30bbbcd77255666946bbdfcdced4b5dbedefa3..6ed463dce0b0e98a0b08501849cb3b56cc3a9162 100644 (file)
@@ -164,7 +164,7 @@ static char *vcal_popup_labels[] =
 {
        N_("_New meeting..."),
        N_("_Export calendar..."),
-       N_("_Subscribe to webCal..."),
+       N_("_Subscribe to Webcal..."),
        N_("_Unsubscribe..."),
        N_("_Rename..."),
        N_("U_pdate subscriptions"),
@@ -746,7 +746,7 @@ GSList *vcal_get_events_list(FolderItem *item)
                event = vcal_manager_load_event(d);
                if (!event)
                        continue;
-               if (event->rec_occurence) {
+               if (event->rec_occurrence) {
                        vcal_manager_free_event(event);
                        claws_unlink(d);
                        continue;
@@ -804,7 +804,7 @@ GSList *vcal_get_events_list(FolderItem *item)
                                                                event->sequence, event->type);
                                        g_free(uid);
                                        vcal_manager_copy_attendees(event, nevent);
-                                       nevent->rec_occurence = TRUE;
+                                       nevent->rec_occurrence = TRUE;
                                        vcal_manager_save_event(nevent, FALSE);
                                        account = vcal_manager_get_account_from_event(event);
                                        status =
@@ -863,7 +863,7 @@ static gint vcal_get_num_list(Folder *folder, FolderItem *item,
                        continue;
                g_hash_table_insert(hash_uids, GINT_TO_POINTER(n_msg), g_strdup(event->uid));
                
-               if (event->rec_occurence) {
+               if (event->rec_occurrence) {
                        vcal_manager_free_event(event);
                        continue;
                }
@@ -1190,7 +1190,7 @@ void vcal_folder_export(Folder *folder)
                    vcalprefs.export_command &&
                    strlen(vcalprefs.export_command))
                        execute_command_line(
-                               vcalprefs.export_command, TRUE);
+                               vcalprefs.export_command, TRUE, NULL);
        }
        if (export_pass != NULL) {
                memset(export_pass, 0, strlen(export_pass));
@@ -1204,7 +1204,7 @@ void vcal_folder_export(Folder *folder)
                    vcalprefs.export_freebusy_command &&
                    strlen(vcalprefs.export_freebusy_command))
                        execute_command_line(
-                               vcalprefs.export_freebusy_command, TRUE);
+                               vcalprefs.export_freebusy_command, TRUE, NULL);
        }
        if (export_freebusy_pass != NULL) {
                memset(export_freebusy_pass, 0, strlen(export_freebusy_pass));
@@ -1832,10 +1832,10 @@ static void update_subscription_finish(const gchar *uri, gchar *feed, gboolean v
        }
        if (strncmp(feed, "BEGIN:VCALENDAR", strlen("BEGIN:VCALENDAR"))) {
                if (verbose && manual_update) {
-                       alertpanel_error(_("This URL does not look like a WebCal URL:\n%s\n%s"),
+                       alertpanel_error(_("This URL does not look like a Webcal URL:\n%s\n%s"),
                                        uri, error ? error:_("Unknown error"));
                } else  {
-                       log_error(LOG_PROTOCOL, _("This URL does not look like a WebCal URL:\n%s\n%s\n"),
+                       log_error(LOG_PROTOCOL, _("This URL does not look like a Webcal URL:\n%s\n%s\n"),
                                        uri, error ? error:_("Unknown error"));
                }
                g_free(feed);
@@ -1852,14 +1852,10 @@ static void update_subscription_finish(const gchar *uri, gchar *feed, gboolean v
                gchar *title = feed_get_title(feed);
                if (title == NULL) {
                        if (strstr(uri, "://"))
-                               title = g_strdup(strstr(uri,"://")+3);
+                               title = g_path_get_basename(strstr(uri,"://")+3);
                        else
                                title = g_strdup(uri);
                        subst_for_filename(title);
-                       if (strlen(title) > 32) {
-                               title[29]=title[30]=title[31]='.';
-                               title[32]='\0';
-                       }
                }
                item = folder_create_folder(root->node->data, title);
                if (!item) {
@@ -1940,7 +1936,7 @@ static void subscribe_cal_cb(GtkAction *action, gpointer data)
        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;
        
@@ -1981,7 +1977,7 @@ static void unsubscribe_cal_cb(GtkAction *action, gpointer data)
 
        message = g_strdup_printf
                (_("Do you really want to unsubscribe?"));
-       avalue = alertpanel_full(_("Delete folder"), message,
+       avalue = alertpanel_full(_("Delete subscription"), message,
                                 GTK_STOCK_CANCEL, GTK_STOCK_DELETE, NULL, 
                                 FALSE, NULL, ALERT_WARNING, G_ALERTDEFAULT);
        g_free(message);
@@ -2111,7 +2107,7 @@ gchar *vcal_get_event_as_ical_str(VCalEvent *event)
             icalproperty_new_prodid(
                  "-//Claws Mail//NONSGML Claws Mail Calendar//EN"),
            icalproperty_new_calscale("GREGORIAN"),
-            0);
+            (void*)0);
        vcal_manager_event_dump(event, FALSE, FALSE, calendar, FALSE);
        ical = g_strdup(icalcomponent_as_ical_string(calendar));
        icalcomponent_free(calendar);