2012-09-12 [colin] 3.8.1cvs52
authorColin Leroy <colin@colino.net>
Wed, 12 Sep 2012 09:23:13 +0000 (09:23 +0000)
committerColin Leroy <colin@colino.net>
Wed, 12 Sep 2012 09:23:13 +0000 (09:23 +0000)
* src/addressbook.c
* src/addrharvest.c
* src/addrindex.c
* src/addritem.c
* src/compose.c
* src/edittags.c
* src/folder.c
* src/imap.c
* src/inc.c
* src/ldif.c
* src/mainwindow.c
* src/mbox.c
* src/mimeview.c
* src/mutt.c
* src/partial_download.c
* src/prefs_filtering_action.c
* src/prefs_toolbar.c
* src/printing.c
* src/procheader.c
* src/procmime.c
* src/procmsg.c
* src/summaryview.c
* src/textview.c
* src/common/utils.c
* src/etpan/imap-thread.c
* src/gtk/gtkaspell.c
* src/plugins/pgpcore/sgpgme.c
More fixes from bug #1961:
- Write-only variables
- Null pointer dereferences
- A couple other fixes for which the reporter
  was unsure, but which showed problems.
More details in bug #1961 comments.

30 files changed:
ChangeLog
PATCHSETS
configure.ac
src/addressbook.c
src/addrharvest.c
src/addrindex.c
src/addritem.c
src/common/utils.c
src/compose.c
src/edittags.c
src/etpan/imap-thread.c
src/folder.c
src/gtk/gtkaspell.c
src/imap.c
src/inc.c
src/ldif.c
src/mainwindow.c
src/mbox.c
src/mimeview.c
src/mutt.c
src/partial_download.c
src/plugins/pgpcore/sgpgme.c
src/prefs_filtering_action.c
src/prefs_toolbar.c
src/printing.c
src/procheader.c
src/procmime.c
src/procmsg.c
src/summaryview.c
src/textview.c

index cbeb65e..5ca427e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+2012-09-12 [colin]     3.8.1cvs52
+
+       * src/addressbook.c
+       * src/addrharvest.c
+       * src/addrindex.c
+       * src/addritem.c
+       * src/compose.c
+       * src/edittags.c
+       * src/folder.c
+       * src/imap.c
+       * src/inc.c
+       * src/ldif.c
+       * src/mainwindow.c
+       * src/mbox.c
+       * src/mimeview.c
+       * src/mutt.c
+       * src/partial_download.c
+       * src/prefs_filtering_action.c
+       * src/prefs_toolbar.c
+       * src/printing.c
+       * src/procheader.c
+       * src/procmime.c
+       * src/procmsg.c
+       * src/summaryview.c
+       * src/textview.c
+       * src/common/utils.c
+       * src/etpan/imap-thread.c
+       * src/gtk/gtkaspell.c
+       * src/plugins/pgpcore/sgpgme.c
+               More fixes from bug #1961:
+               - Write-only variables
+               - Null pointer dereferences
+               - A couple other fixes for which the reporter
+                 was unsure, but which showed problems.
+               More details in bug #1961 comments.
+
 2012-09-12 [colin]     3.8.1cvs51
 
        * src/compose.c
index 5f6a5e9..e1d1fb8 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.115.2.255 -r 1.115.2.256 src/main.c;  ) > 3.8.1cvs49.patchset
 ( cvs diff -u -r 1.1.2.3 -r 1.1.2.4 claws-mail.pc.in;  ) > 3.8.1cvs50.patchset
 ( cvs diff -u -r 1.382.2.610 -r 1.382.2.611 src/compose.c;  cvs diff -u -r 1.79.2.75 -r 1.79.2.76 src/mh.c;  cvs diff -u -r 1.9.2.55 -r 1.9.2.56 src/common/ssl.c;  cvs diff -u -r 1.1.2.37 -r 1.1.2.38 src/plugins/pgpcore/passphrase.c;  ) > 3.8.1cvs51.patchset
+( cvs diff -u -r 1.60.2.149 -r 1.60.2.150 src/addressbook.c;  cvs diff -u -r 1.6.10.27 -r 1.6.10.28 src/addrharvest.c;  cvs diff -u -r 1.28.2.49 -r 1.28.2.50 src/addrindex.c;  cvs diff -u -r 1.13.2.22 -r 1.13.2.23 src/addritem.c;  cvs diff -u -r 1.382.2.611 -r 1.382.2.612 src/compose.c;  cvs diff -u -r 1.1.2.28 -r 1.1.2.29 src/edittags.c;  cvs diff -u -r 1.213.2.210 -r 1.213.2.211 src/folder.c;  cvs diff -u -r 1.179.2.259 -r 1.179.2.260 src/imap.c;  cvs diff -u -r 1.149.2.109 -r 1.149.2.110 src/inc.c;  cvs diff -u -r 1.12.2.25 -r 1.12.2.26 src/ldif.c;  cvs diff -u -r 1.274.2.350 -r 1.274.2.351 src/mainwindow.c;  cvs diff -u -r 1.28.2.52 -r 1.28.2.53 src/mbox.c;  cvs diff -u -r 1.83.2.194 -r 1.83.2.195 src/mimeview.c;  cvs diff -u -r 1.6.10.21 -r 1.6.10.22 src/mutt.c;  cvs diff -u -r 1.1.2.27 -r 1.1.2.28 src/partial_download.c;  cvs diff -u -r 1.1.4.78 -r 1.1.4.79 src/prefs_filtering_action.c;  cvs diff -u -r 1.30.2.73 -r 1.30.2.74 src/prefs_toolbar.c;  cvs diff -u -r 1.1.2.38 -r 1.1.2.39 src/printing.c;  cvs diff -u -r 1.47.2.58 -r 1.47.2.59 src/procheader.c;  cvs diff -u -r 1.49.2.149 -r 1.49.2.150 src/procmime.c;  cvs diff -u -r 1.150.2.126 -r 1.150.2.127 src/procmsg.c;  cvs diff -u -r 1.395.2.452 -r 1.395.2.453 src/summaryview.c;  cvs diff -u -r 1.96.2.247 -r 1.96.2.248 src/textview.c;  cvs diff -u -r 1.36.2.200 -r 1.36.2.201 src/common/utils.c;  cvs diff -u -r 1.1.4.119 -r 1.1.4.120 src/etpan/imap-thread.c;  cvs diff -u -r 1.9.2.80 -r 1.9.2.81 src/gtk/gtkaspell.c;  cvs diff -u -r 1.1.2.73 -r 1.1.2.74 src/plugins/pgpcore/sgpgme.c;  ) > 3.8.1cvs52.patchset
index 4417d09..2ccc382 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=51
+EXTRA_VERSION=52
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 514e839..1004b91 100644 (file)
@@ -2900,7 +2900,7 @@ static void addressbook_treenode_delete_cb(GtkAction *action, gpointer data)
        /* Confirm deletion */
        delType = ADDRTREE_DEL_NONE;
        if( obj->type == ADDR_ITEM_FOLDER ) {
-               if( iface->externalQuery ) {
+               if( iface && iface->externalQuery ) {
                        message = g_strdup_printf( _(
                                "Do you want to delete the query " \
                                "results and addresses in '%s' ?" ),
@@ -2967,7 +2967,7 @@ static void addressbook_treenode_delete_cb(GtkAction *action, gpointer data)
        cache = adbase->addressCache;
 
        /* Remove query results folder */
-       if( iface->externalQuery ) {
+       if( iface && iface->externalQuery ) {
                AdapterFolder *adapter = ADAPTER_FOLDER(obj);
                ItemFolder *folder = adapter->itemFolder;
 
@@ -3708,11 +3708,9 @@ static void addressbook_folder_refresh_one_person( GtkCMCTree *clist, ItemPerson
 
 static void addressbook_folder_remove_one_person( GtkCMCTree *clist, ItemPerson *person ) {
        GtkCMCTreeNode *node;
-       gint row;
        
        if( person == NULL ) return;
        node = gtk_cmctree_find_by_row_data( clist, NULL, person );
-       row  = gtk_cmclist_find_row_from_data( GTK_CMCLIST(clist), person );
        if( node ) {
                addressbook_folder_remove_node( clist, node );
        }
@@ -3875,15 +3873,15 @@ static void addressbook_set_clist( AddressObject *obj, gboolean refresh ) {
 
        if( obj->type == ADDR_DATASOURCE ) {
                ads = ADAPTER_DSOURCE(obj);
-               ds = ADAPTER_DSOURCE(obj)->dataSource;
+               ds = ads->dataSource;
                if( ds ) {
                        /* Load root folder */
                        ItemFolder *rootFolder = NULL;
                        rootFolder = addrindex_ds_get_root_folder( ds );
                        addressbook_folder_load_person(
-                               ctreelist, addrindex_ds_get_root_folder( ds ) );
+                               ctreelist, rootFolder );
                        addressbook_folder_load_group(
-                               ctreelist, addrindex_ds_get_root_folder( ds ) );
+                               ctreelist, rootFolder );
                }
        }
        else {
@@ -4577,8 +4575,6 @@ static void addressbook_perform_search(
                AddressDataSource *ds, gchar *searchTerm,
                GtkCMCTreeNode *pNode )
 {
-       AddrBookBase *adbase;
-       AddressCache *cache;
        ItemFolder *folder;
        gchar *name;
        gint queryID;
@@ -4598,9 +4594,6 @@ static void addressbook_perform_search(
        else {
                return;
        }
-       /* Get reference to address cache */    
-       adbase = ( AddrBookBase * ) ds->rawDataSource;
-       cache = adbase->addressCache;
 
        /* Create a folder for the search results */
        name = g_strdup_printf( _queryFolderLabel_, searchTerm );
index 4ba2cf5..b0d08ac 100644 (file)
@@ -577,13 +577,10 @@ static void addrharvest_parse_address(
                        mgu_str_ltc2space( buffer, '(', ')' );
                        g_strstrip( buffer );
 
-                       if( g_ascii_strcasecmp( buffer, email ) == 0 ) {
+                       if( g_ascii_strcasecmp( buffer, email ) == 0 )
                                name = g_strdup("");
-                       }
-                       else {
-                               name = buffer;
+                       else
                                name = conv_unmime_header(buffer, NULL, TRUE);
-                       }
 
                        /* Insert into address book */
 #ifndef USE_NEW_ADDRBOOK
index 41ea423..512a6e0 100644 (file)
@@ -1572,7 +1572,6 @@ static int addrindex_write_ldap( FILE *fp, AddressDataSource *ds, gint lvl ) {
  * \param  file Address index file.
  */
 static void addrindex_read_index( AddressIndex *addrIndex, XMLFile *file ) {
-       guint prev_level;
        XMLTag *xtag;
        AddressInterface *iface = NULL, *dsIFace = NULL;
        AddressDataSource *ds;
@@ -1580,7 +1579,6 @@ static void addrindex_read_index( AddressIndex *addrIndex, XMLFile *file ) {
 
        addrIndex->loadedFlag = FALSE;
        for (;;) {
-               prev_level = file->level;
                rc = xml_parse_next_tag( file );
                if( file->level == 0 ) return;
 
index fc37244..3c95432 100644 (file)
@@ -589,7 +589,7 @@ void addritem_person_add_attribute(
  * \param  attrib Attribute to remove.
  */
 void addritem_person_remove_attribute( ItemPerson *person, const gchar *attrib ) {
-       cm_return_if_fail( person != NULL || attrib != NULL );
+       cm_return_if_fail( person != NULL && attrib != NULL );
        GList *attrib_list;
 
        attrib_list = person->listAttrib;
index ac418f5..a183679 100644 (file)
@@ -706,7 +706,7 @@ void eliminate_parenthesis(gchar *str, gchar op, gchar cl)
        register gchar *srcp, *destp;
        gint in_brace;
 
-       srcp = destp = str;
+       destp = str;
 
        while ((destp = strchr(destp, op))) {
                in_brace = 1;
@@ -730,7 +730,7 @@ void extract_parenthesis(gchar *str, gchar op, gchar cl)
        register gchar *srcp, *destp;
        gint in_brace;
 
-       srcp = destp = str;
+       destp = str;
 
        while ((srcp = strchr(destp, op))) {
                if (destp > str)
@@ -759,7 +759,7 @@ static void extract_parenthesis_with_skip_quote(gchar *str, gchar quote_chr,
        gint in_brace;
        gboolean in_quote = FALSE;
 
-       srcp = destp = str;
+       destp = str;
 
        while ((srcp = strchr_with_skip_quote(destp, quote_chr, op))) {
                if (destp > str)
@@ -805,7 +805,7 @@ void eliminate_address_comment(gchar *str)
        register gchar *srcp, *destp;
        gint in_brace;
 
-       srcp = destp = str;
+       destp = str;
 
        while ((destp = strchr(destp, '"'))) {
                if ((srcp = strchr(destp + 1, '"'))) {
@@ -822,7 +822,7 @@ void eliminate_address_comment(gchar *str)
                }
        }
 
-       srcp = destp = str;
+       destp = str;
 
        while ((destp = strchr_with_skip_quote(destp, '"', '('))) {
                in_brace = 1;
@@ -2886,7 +2886,7 @@ gint canonicalize_file_replace(const gchar *file)
 
 gchar *normalize_newlines(const gchar *str)
 {
-       const gchar *p = str;
+       const gchar *p;
        gchar *out, *outp;
 
        out = outp = g_malloc(strlen(str) + 1);
@@ -4021,7 +4021,7 @@ void get_hex_str(gchar *out, guchar ch)
        INT_TO_HEX(hex, ch >> 4);
        *out++ = hex;
        INT_TO_HEX(hex, ch & 0x0f);
-       *out++ = hex;
+       *out   = hex;
 }
 
 #undef REF_DEBUG
@@ -5250,7 +5250,7 @@ size_t fast_strftime(gchar *buf, gint buflen, const gchar *format, struct tm *lt
                        *curpos++ = *format++; 
                }
        }
-       *curpos++ = '\0';
+       *curpos = '\0';
        return total_done;
 }
 
index a5d57ac..0dd6249 100644 (file)
@@ -889,10 +889,7 @@ static void compose_create_tags(GtkTextView *text, Compose *compose)
 
        for (i = 0; i < 8; i++) {
                if (success[i] == FALSE) {
-                       GtkStyle *style;
-
                        g_warning("Compose: color allocation failed.\n");
-                       style = gtk_widget_get_style(GTK_WIDGET(text));
                        quote_color1 = quote_color2 = quote_color3 = 
                                quote_bgcolor1 = quote_bgcolor2 = quote_bgcolor3 = 
                                signature_color = uri_color = black;
@@ -2344,8 +2341,8 @@ Compose *compose_reedit(MsgInfo *msginfo, gboolean batch)
        }
 
        if (fp != NULL) {
-               gboolean prev_autowrap = compose->autowrap;
-               GtkTextBuffer *buffer = textbuf;
+               gboolean prev_autowrap;
+               GtkTextBuffer *buffer;
                BLOCK_WRAP();
                while (fgets(buf, sizeof(buf), fp) != NULL) {
                        strcrchomp(buf);
@@ -2568,8 +2565,6 @@ void compose_entry_append(Compose *compose, const gchar *address,
                gchar *tmp = g_strdup(begin);
                gchar *o_tmp = tmp;
                tmp[cur-begin]='\0';
-               cur++;
-               begin = cur;
                while (*tmp == ' ' || *tmp == '\t')
                        tmp++;
                compose_add_header_entry(compose, header, tmp, pref_type);
@@ -7036,8 +7031,6 @@ static GtkWidget *compose_create_others(Compose *compose)
                         G_CALLBACK(compose_savemsg_select_cb),
                         compose);
 
-       rowcount++;
-
        return table;   
 }
 
index 06806a2..67fcef6 100644 (file)
@@ -236,7 +236,7 @@ static void apply_popup_delete (GtkAction *action, gpointer data)
 
 static void apply_popup_delete_all (GtkAction *action, gpointer data)
 {
-       GSList *cur;
+       GSList *cur, *tags;
        GtkTreeModel *model;
        SummaryView *summaryview = NULL;
        
@@ -252,13 +252,14 @@ static void apply_popup_delete_all (GtkAction *action, gpointer data)
 
        if (mainwindow_get_mainwindow() != NULL)
                summaryview = mainwindow_get_mainwindow()->summaryview;
-       cur = tags_get_list();
+       cur = tags = tags_get_list();
        for (; cur; cur = cur->next) {
                gint id = GPOINTER_TO_INT(cur->data);
                if (summaryview)
                        summary_set_tag(summaryview, -id, NULL);
                tags_remove_tag(id);
        }
+       g_slist_free(tags);
        tags_write_tags();
 
        APPLYWINDOW_UNLOCK();
@@ -756,13 +757,14 @@ static void apply_window_list_view_insert_tag(GtkWidget *list_view,
 
 static void apply_window_load_tags (void) 
 {
-       GSList *cur;
+       GSList *cur, *tags;
        gint id;
        apply_window_list_view_clear_tags(applywindow.taglist);
        
-       cur = tags_get_list();
+       cur = tags = tags_get_list();
        for (; cur; cur = cur->next) {
                id = GPOINTER_TO_INT(cur->data);
                apply_window_list_view_insert_tag(applywindow.taglist, NULL, id);
        }
+       g_slist_free(tags);
 }
index 7a1c2e7..0266ce8 100644 (file)
@@ -2649,10 +2649,8 @@ imap_fetch_result_to_envelop_list(clist * fetch_result,
                                  carray ** p_env_list)
 {
        clistiter * cur;
-       unsigned int i;
        carray * env_list;
 
-       i = 0;
        env_list = carray_new(16);
   
        if (fetch_result) {
index ad1edb1..c596f9f 100644 (file)
@@ -407,7 +407,7 @@ void folder_item_remove(FolderItem *item)
        cm_return_if_fail(item->folder != NULL);
        cm_return_if_fail(item->folder->node != NULL);
 
-       start_node = node = item->node;
+       start_node = item->node;
        
        node = item->folder->node;
        
@@ -2775,13 +2775,11 @@ void folder_item_write_cache(FolderItem *item)
 
 MsgInfo *folder_item_get_msginfo(FolderItem *item, gint num)
 {
-       Folder *folder;
        MsgInfo *msginfo = NULL;
        
        cm_return_val_if_fail(item != NULL, NULL);
        if (item->no_select)
                return NULL;
-       folder = item->folder;
        if (!item->cache)
                folder_item_read_cache(item);
        
@@ -2799,7 +2797,6 @@ MsgInfo *folder_item_get_msginfo(FolderItem *item, gint num)
 
 MsgInfo *folder_item_get_msginfo_by_msgid(FolderItem *item, const gchar *msgid)
 {
-       Folder *folder;
        MsgInfo *msginfo;
        
        cm_return_val_if_fail(item != NULL, NULL);
@@ -2807,7 +2804,6 @@ MsgInfo *folder_item_get_msginfo_by_msgid(FolderItem *item, const gchar *msgid)
        if (item->no_select)
                return FALSE;
        
-       folder = item->folder;
        if (!item->cache)
                folder_item_read_cache(item);
        
@@ -3342,8 +3338,6 @@ gint folder_item_move_to(FolderItem *src, FolderItem *dest, FolderItem **new_ite
                tmp = folder_item_parent(tmp);
        }
        
-       tmp = folder_item_parent(src);
-       
        src_identifier = folder_item_get_identifier(src);
        dst_identifier = folder_item_get_identifier(dest);
        
index 0ac6efb..717396d 100644 (file)
@@ -561,7 +561,7 @@ static void entry_delete_cb(GtkTextBuffer *textbuf,
                            GtkAspell *gtkaspell)
 {
        int origpos;
-       gint start, end;
+       gint start;
     
        cm_return_if_fail(gtkaspell->gtkaspeller->speller);
 
@@ -569,7 +569,6 @@ static void entry_delete_cb(GtkTextBuffer *textbuf,
                return;
 
        start = gtk_text_iter_get_offset(startiter);
-       end = gtk_text_iter_get_offset(enditer);
        origpos = get_textview_buffer_offset(gtkaspell->gtktext);
        if (start) {
                check_at(gtkaspell, start - 1);
@@ -961,12 +960,9 @@ static gboolean check_at(GtkAspell *gtkaspell, gint from_pos)
 {
        gint          start, end;
        char buf[GTKASPELLWORDSIZE];
-       GtkTextView     *gtktext;
 
        cm_return_val_if_fail(from_pos >= 0, FALSE);
     
-       gtktext = gtkaspell->gtktext;
-
        if (!get_word_from_pos(gtkaspell, from_pos, buf, sizeof(buf), 
                               &start, &end))
                return FALSE;
@@ -1272,7 +1268,7 @@ void gtkaspell_unblock_check(GtkAspell *gtkaspell)
 
 static void replace_real_word(GtkAspell *gtkaspell, const gchar *newword)
 {
-       int             oldlen, newlen, wordlen;
+       int             oldlen, newlen;
        gint            origpos;
        gint            pos;
        GtkTextView     *gtktext;
@@ -1287,7 +1283,6 @@ static void replace_real_word(GtkAspell *gtkaspell, const gchar *newword)
        origpos = gtkaspell->orig_pos;
        pos     = origpos;
        oldlen  = gtkaspell->end_pos - gtkaspell->start_pos;
-       wordlen = strlen(gtkaspell->theword);
 
        newlen = strlen(newword); /* FIXME: multybyte characters? */
 
@@ -1342,10 +1337,7 @@ static void replace_real_word_cb(gpointer data, const gchar *newword)
 /* Accept this word for this session */
 static void add_word_to_session_cb(GtkWidget *w, gpointer data)
 {
-       GtkTextView *gtktext;
        GtkAspell *gtkaspell = (GtkAspell *) data; 
-       gtktext = gtkaspell->gtktext;
-
 
        enchant_dict_add_to_session(gtkaspell->gtkaspeller->speller, gtkaspell->theword, strlen(gtkaspell->theword));
 
@@ -1436,7 +1428,6 @@ static void replace_with_create_dialog_cb(GtkWidget *w, gpointer data)
        static PangoFontDescription *font_desc;
        GtkWidget *dialog;
        GtkWidget *label;
-       GtkWidget *w_hbox;
        GtkWidget *hbox;
        GtkWidget *vbox;
        GtkWidget *entry;
@@ -1474,8 +1465,6 @@ static void replace_with_create_dialog_cb(GtkWidget *w, gpointer data)
        thelabel = g_strdup_printf(_("<span weight=\"bold\" "
                                        "size=\"larger\">Replace \"%s\" with: </span>"), 
                                   utf8buf);
-       /* for title label */
-       w_hbox = gtk_hbox_new(FALSE, 0);
        
        icon = gtk_image_new_from_stock(GTK_STOCK_DIALOG_QUESTION,
                                        GTK_ICON_SIZE_DIALOG); 
@@ -1524,8 +1513,6 @@ static void replace_with_create_dialog_cb(GtkWidget *w, gpointer data)
        gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
        gtk_widget_show(label);
 
-       hbox = gtk_hbox_new(TRUE, 0);
-
        gtkut_stock_button_set_create(&confirm_area,
                                      &cancel_button, GTK_STOCK_CANCEL,
                                      &ok_button, GTK_STOCK_OK,
@@ -1813,8 +1800,6 @@ static GtkWidget *make_dictionary_list_submenu(GtkAspell *gtkaspell)
        if (gtkaspellcheckers->dictionary_list == NULL)
                gtkaspell_get_dictionary_list(FALSE);
 
-       tmp = gtkaspellcheckers->dictionary_list;
-
        menu = gtk_menu_new();
        curmenu = menu;
 
@@ -1868,12 +1853,10 @@ static GSList *make_sug_menu(GtkAspell *gtkaspell)
 {
        GtkWidget       *item, *submenu;
        char    *caption;
-       GtkTextView     *gtktext;
        GtkAccelGroup   *accel;
        GList           *l = gtkaspell->suggestions_list;
        gchar           *utf8buf;
        GSList *list = NULL;
-       gtktext = gtkaspell->gtktext;
 
        if (l == NULL)
                return NULL;
@@ -2274,10 +2257,6 @@ static void switch_to_alternate_cb(GtkWidget *w,
 
 static void set_point_continue(GtkAspell *gtkaspell)
 {
-       GtkTextView  *gtktext;
-
-       gtktext = gtkaspell->gtktext;
-
        gtkaspell->ctx.set_position(gtkaspell->ctx.data, gtkaspell->orig_pos);
 
        if (gtkaspell->continue_check)
index 493ff31..b426f40 100644 (file)
@@ -1749,7 +1749,6 @@ static gint imap_do_copy_msgs(Folder *folder, FolderItem *dest,
        gint ok = MAILIMAP_NO_ERROR;
        GHashTable *uid_hash;
        gint last_num = 0;
-       gboolean single = FALSE;
 
        g_return_val_if_fail(folder != NULL, -1);
        g_return_val_if_fail(dest != NULL, -1);
@@ -1763,8 +1762,6 @@ static gint imap_do_copy_msgs(Folder *folder, FolderItem *dest,
        }
 
        msginfo = (MsgInfo *)msglist->data;
-       if (msglist->next == NULL)
-               single = TRUE;
        src = msginfo->folder;
        if (src == dest) {
                g_warning("the src folder is identical to the dest.\n");
@@ -3077,9 +3074,7 @@ static GSList *imap_get_uncached_messages(IMAPSession *session,
        GSList *result = NULL;
        GSList * cur;
        uncached_data *data = g_new0(uncached_data, 1);
-       int finished;
        
-       finished = 0;
        cur = numlist;
        data->total = g_slist_length(numlist);
        data->ok = MAILIMAP_NO_ERROR;
@@ -3965,7 +3960,7 @@ static gint get_list_of_uids(IMAPSession *session, Folder *folder, IMAPFolderIte
        GSList *uidlist, *elem;
        int r = -1;
        clist * lep_uidlist;
-       gint ok, nummsgs = 0, lastuid_old;
+       gint ok, nummsgs = 0;
 
        if (session == NULL) {
                return -1;
@@ -4015,8 +4010,6 @@ static gint get_list_of_uids(IMAPSession *session, Folder *folder, IMAPFolderIte
                return -1;
        }
 
-       lastuid_old = item->lastuid;
-
        for (elem = uidlist; elem != NULL; elem = g_slist_next(elem)) {
                guint msgnum;
 
@@ -4041,7 +4034,6 @@ gint imap_get_num_list(Folder *folder, FolderItem *_item, GSList **msgnum_list,
        gint nummsgs;
        GSList *uidlist = NULL;
        gchar *dir;
-       gboolean selected_folder;
        gint known_list_len = 0;
        debug_print("get_num_list\n");
        
@@ -4085,9 +4077,6 @@ gint imap_get_num_list(Folder *folder, FolderItem *_item, GSList **msgnum_list,
                statusbar_print_all(_("Scanning folder %s ..."),
                                      FOLDER_ITEM(item)->folder->name);
 
-       selected_folder = (session->mbox != NULL) &&
-                         (!strcmp(session->mbox, item->item.path));
-       
        if (item->should_trash_cache) {
                *old_uids_valid = FALSE;
                debug_print("get_num_list: trashing num list\n");
@@ -5702,7 +5691,6 @@ char* imap_modified_utf7_to_utf8(const char *mbox, gboolean change_spaces)
   const char *src;
   char *dst, *res  = g_malloc(2*strlen(mbox)+1);
 
-  bitbuf = 0;
   dst = res;
   src = mbox;
   if(!dst) return NULL;
@@ -5836,7 +5824,6 @@ char* imap_utf8_to_modified_utf7(const char *src, gboolean change_spaces)
     /* Encode US-ASCII characters as themselves */
     if (c < 0x80) {
       ucs4 = c;
-      utf8total = 1;
     } else if (utf8total) {
       /* save UTF8 bits into UCS4 */
       ucs4 = (ucs4 << 6) | (c & 0x3FUL);
index c632756..b7cb86e 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -183,7 +183,7 @@ static void inc_finished(MainWindow *mainwin, gboolean new_messages, gboolean au
 
                if (cur_account && cur_account->inbox)
                        item = folder_find_item_from_identifier(cur_account->inbox);
-               if (item == NULL && cur_account->folder)
+               if (item == NULL && cur_account && cur_account->folder)
                        item = cur_account->folder->inbox;
                if (item == NULL)
                        item = folder_get_default_inbox();
index cb710a0..a34c40e 100644 (file)
@@ -718,7 +718,6 @@ static void ldif_read_file( LdifFile *ldifFile, AddressCache *cache ) {
                                                        mgu_free_list( listValue );
                                                        lastTag = NULL;
                                                        listValue = NULL;
-                                                       last64 = FALSE;
                                                }
 
                                                lastTag = g_strdup( tagName );
index e951087..b9de425 100644 (file)
@@ -2918,7 +2918,6 @@ void main_window_toggle_message_view(MainWindow *mainwin)
                }
                break;
        case WIDE_LAYOUT:
-               ppaned = mainwin->hpaned;
                container = mainwin->vpaned;
                if (gtk_widget_get_parent(mainwin->messageview->vbox) != NULL) {
                        mainwin->messageview->visible = FALSE;
@@ -3391,7 +3390,6 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                              messageview_is_visible(mainwin->messageview));
 
        summaryview = mainwin->summaryview;
-       menu_path = "Menu/View/Sort/DontSort";
 
        switch (summaryview->sort_key) {
        case SORT_BY_NUMBER:
index 38ad1d0..89c1677 100644 (file)
@@ -154,15 +154,11 @@ gint proc_mbox(FolderItem *dest, const gchar *mbox, gboolean apply_filter,
 
                empty_lines = 0;
                lines = 0;
-               more = FALSE;
 
                /* process all lines from mboxrc file */
                while (fgets(buf, sizeof(buf), mbox_fp) != NULL) {
                        int offset;
 
-                       /* eof not reached, expect more lines */
-                       more = TRUE;
-
                        /* eat empty lines */
                        if (buf[0] == '\n' || buf[0] == '\r') {
                                empty_lines++;
index 9d2c3aa..574407d 100644 (file)
@@ -1050,13 +1050,11 @@ static void update_signature_noticeview(MimeView *mimeview, MimeInfo *mimeinfo,
                icon = STOCK_PIXMAP_PRIVACY_FAILED;
                break;
        case SIGNATURE_CHECK_FAILED:
-               button_text = _("Check again");
-               func = check_signature_cb;
-               icon = STOCK_PIXMAP_PRIVACY_UNKNOWN;
        case SIGNATURE_CHECK_TIMEOUT:
                button_text = _("Check again");
                func = check_signature_cb;
                icon = STOCK_PIXMAP_PRIVACY_UNKNOWN;
+               break;
        default:
                break;
        }
index 08d9d89..4e51af1 100644 (file)
@@ -212,9 +212,9 @@ static GSList *mutt_parse_rcplist( gchar *rcpList, gint *addrCount ) {
        list = NULL;
        cnt = 0;
        pStart = rcpList;
-       while( *pStart ) {
+       while( pStart && *pStart ) {
                ptr = pStart;
-               address = name = NULL;
+               address = NULL;
                pName = pAddr = NULL;
                /* Chew up spaces */
                while( *ptr ) {
index 91f2600..6ef11b9 100644 (file)
@@ -72,7 +72,6 @@ int partial_msg_in_uidl_list(MsgInfo *msginfo)
        gchar uidl[POPBUFSIZE];
        time_t recv_time;
        time_t now;
-       gint partial_recv;
        gchar *sanitized_uid = NULL;
        
        if (!msginfo->extradata)
@@ -112,7 +111,6 @@ int partial_msg_in_uidl_list(MsgInfo *msginfo)
                gchar tmp[POPBUFSIZE];
                strretchomp(buf);
                recv_time = RECV_TIME_NONE;
-               partial_recv = POP3_TOTALLY_RECEIVED;
                
                if (sscanf(buf, "%s\t%ld\t%s", uidl, (long int *) &recv_time, 
                           tmp) < 2) {
@@ -386,7 +384,6 @@ gchar *partial_get_filename(const gchar *server, const gchar *login,
        gchar uidl[POPBUFSIZE];
        time_t recv_time;
        time_t now;
-       gint partial_recv;
        gchar *sanitized_uid = g_strdup(login); 
 
        subst_for_filename(sanitized_uid);
@@ -416,7 +413,6 @@ gchar *partial_get_filename(const gchar *server, const gchar *login,
                gchar tmp[POPBUFSIZE];
                strretchomp(buf);
                recv_time = RECV_TIME_NONE;
-               partial_recv = POP3_TOTALLY_RECEIVED;
                
                if (sscanf(buf, "%s\t%ld\t%s", uidl, (long int *) &recv_time, 
                           tmp) < 2) {
index 6929165..7d0fd9f 100644 (file)
@@ -85,7 +85,6 @@ gpgme_verify_result_t sgpgme_verify_signature(gpgme_ctx_t ctx, gpgme_data_t sig,
 
 SignatureStatus sgpgme_sigstat_gpgme_to_privacy(gpgme_ctx_t ctx, gpgme_verify_result_t status)
 {
-       unsigned long validity = 0;
        gpgme_signature_t sig = NULL;
        
        if (GPOINTER_TO_INT(status) == -GPG_ERR_SYSTEM_ERROR) {
@@ -103,7 +102,6 @@ SignatureStatus sgpgme_sigstat_gpgme_to_privacy(gpgme_ctx_t ctx, gpgme_verify_re
                debug_print("sig == NULL\n");
                return SIGNATURE_UNCHECKED;
        }
-       validity = sig->validity;
 
        debug_print("err code %d\n", gpg_err_code(sig->status));
        switch (gpg_err_code(sig->status)) {
index 26cf435..597b9b9 100644 (file)
@@ -543,6 +543,7 @@ static void prefs_filtering_action_create(void)
                gtk_combo_box_append_text(GTK_COMBO_BOX(tags_combo), (gpointer) name);
                g_free(name);
        }
+       g_slist_free(tags);
 
        prefs_filtering_action_check_widget_width(tags_combo);
        gtk_combo_box_set_active(GTK_COMBO_BOX(tags_combo), 0);
index 43b45f6..bc55950 100644 (file)
@@ -1602,11 +1602,9 @@ static gboolean icon_window_button_press(GtkWidget *widget,
                                               GdkEventButton *event,
                                               ToolbarPage *prefs_toolbar )
 {
-       GtkWidget *event_widget, *button;
+       GtkWidget *event_widget;
        gboolean restore = TRUE;
 
-       button = prefs_toolbar->icon_button;
-
        /* Test where mouse was clicked */
        event_widget = gtk_get_event_widget((GdkEvent *)event);
        if (event_widget != widget) {
index 494fbbf..8a969ad 100644 (file)
@@ -884,7 +884,6 @@ static void printing_textview_cb_begin_print(GtkPrintOperation *op, GtkPrintCont
        PangoFontDescription *desc;
        int start, ii;
        PangoLayoutIter *iter;
-       double start_pos;
        gint header_end_pos;
        gint num_header_lines;
        gint dummy;
@@ -923,7 +922,6 @@ static void printing_textview_cb_begin_print(GtkPrintOperation *op, GtkPrintCont
        page_height = 0;
        start = 0;
        ii = 0;
-       start_pos = 0.;
        iter = pango_layout_get_iter(print_data->layout);
 
        /* find the last character of the header */
index 8d4ef4a..8e82302 100644 (file)
@@ -284,7 +284,7 @@ static gboolean header_is_addr_field(const gchar *hdr)
 
 Header * procheader_parse_header(gchar * buf)
 {
-       gchar *p = buf;
+       gchar *p;
        Header * header;
        gboolean addr_field = FALSE;
 
index 611e82f..eb29c1c 100644 (file)
@@ -1536,7 +1536,6 @@ static void procmime_parse_multipart(MimeInfo *mimeinfo, gboolean short_scan)
        gchar buf[BUFFSIZE];
        FILE *fp;
        int result = 0;
-       gboolean done = FALSE;
        gboolean start_found = FALSE;
        gboolean end_found = FALSE;
 
@@ -1572,10 +1571,9 @@ static void procmime_parse_multipart(MimeInfo *mimeinfo, gboolean short_scan)
                                                        hentry[6].body, hentry[7].body,
                                                        mimeinfo->data.filename, lastoffset,
                                                        len, short_scan);
-                               if (result == 1 && short_scan) {
-                                       done = TRUE;
+                               if (result == 1 && short_scan)
                                        break;
-                               }
+                               
                        } 
                        
                        if (buf[2 + boundary_len]     == '-' &&
index d5d7bc4..a6749e9 100644 (file)
@@ -827,7 +827,6 @@ static GSList *procmsg_list_sort_by_account(FolderItem *queue, GSList *list)
        debug_print("\n");
 
 parse_again:   
-       nothing_to_sort = TRUE;
        cur = orig;
        while (cur) {
                gchar *file = NULL;
@@ -844,6 +843,7 @@ parse_again:
                        nothing_to_sort = FALSE;
                        goto parse_again;
                }
+               nothing_to_sort = TRUE;
                cur = cur->next;
        }
        
@@ -875,7 +875,7 @@ static gboolean procmsg_is_last_for_account(FolderItem *queue, MsgInfo *msginfo,
 {
        gchar *file = folder_item_fetch_msg(queue, msginfo->msgnum);
        PrefsAccount *ac = procmsg_get_account_from_file(file);
-       GSList *cur = elem;
+       GSList *cur;
        g_free(file);
        for (cur = elem; cur; cur = cur->next) {
                MsgInfo *cur_msginfo = (MsgInfo *)cur->data;
@@ -1526,8 +1526,6 @@ static gint procmsg_send_message_queue_full(const gchar *file, gboolean keep_ses
        gboolean save_clear_text = TRUE;
        gchar *tmp_enc_file = NULL;
 
-       int local = 0;
-
        cm_return_val_if_fail(file != NULL, -1);
 
        if ((fp = g_fopen(file, "rb")) == NULL) {
@@ -1671,7 +1669,6 @@ send_mail:
                } else if (mailac && mailac->use_mail_command &&
                           mailac->mail_command && (* mailac->mail_command)) {
                        mailval = send_message_local(mailac->mail_command, fp);
-                       local = 1;
                } else {
                        if (!mailac) {
                                mailac = account_find_from_smtp_server(from, smtpserver);
index 2db6bc7..799d709 100644 (file)
@@ -3896,7 +3896,6 @@ static void summary_mark_row(SummaryView *summaryview, GtkCMCTreeNode *row)
 
 static void summary_lock_row(SummaryView *summaryview, GtkCMCTreeNode *row)
 {
-       gboolean changed = FALSE;
        GtkCMCTree *ctree = GTK_CMCTREE(summaryview->ctree);
        MsgInfo *msginfo;
 
@@ -3906,11 +3905,9 @@ static void summary_lock_row(SummaryView *summaryview, GtkCMCTreeNode *row)
                summaryview->deleted--;
        if (MSG_IS_MOVE(msginfo->flags)) {
                summaryview->moved--;
-               changed = TRUE;
        }
        if (MSG_IS_COPY(msginfo->flags)) {
                summaryview->copied--;
-               changed = TRUE;
        }
        procmsg_msginfo_set_to_folder(msginfo, NULL);
        summary_msginfo_change_flags(msginfo, MSG_LOCKED, 0, MSG_DELETED, 
@@ -6018,7 +6015,6 @@ static void summary_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
        for (; sel != NULL; sel = sel->next) {
                MsgInfo *msginfo;
                GSList *tags = NULL;
-               gint id;
                GtkCheckMenuItem *item;
                msginfo = gtk_cmctree_node_get_row_data
                        (GTK_CMCTREE(summaryview->ctree),
@@ -6031,7 +6027,6 @@ static void summary_tags_menu_item_activate_item_cb(GtkMenuItem *menu_item,
 
                        for (; tags; tags = tags->next) {
                                gint num_checked = GPOINTER_TO_INT(g_hash_table_lookup(menu_allsel_table, tags->data));
-                               id = GPOINTER_TO_INT(tags->data);
                                item = g_hash_table_lookup(menu_table, GINT_TO_POINTER(tags->data));
                                if (item && !gtk_check_menu_item_get_active(item)) {
                                        gtk_check_menu_item_set_active
@@ -6620,7 +6615,6 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
        GtkCMCTree *ctree = GTK_CMCTREE(widget);
        GtkCMCTreeNode *node;
        MessageView *messageview;
-       TextView *textview;
        GtkAdjustment *adj;
        gboolean mod_pressed;
 
@@ -6631,7 +6625,6 @@ static gboolean summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                return FALSE;
 
        messageview = summaryview->messageview;
-       textview = messageview->mimeview->textview;
 
        mod_pressed =
                ((event->state & (GDK_SHIFT_MASK|GDK_MOD1_MASK)) != 0);
index ef0dcf5..ef23808 100644 (file)
@@ -1361,7 +1361,7 @@ static void textview_make_clickable_parts(TextView *textview,
        gtk_text_buffer_get_end_iter(buffer, &iter);
 
        /* parse for clickable parts, and build a list of begin and end positions  */
-       for (walk = mybuf, n = 0;;) {
+       for (walk = mybuf;;) {
                gint last_index = PARSE_ELEMS;
                gchar *scanpos = NULL;
 
@@ -1481,7 +1481,7 @@ static void textview_make_clickable_parts_later(TextView *textview,
        offset = gtk_text_iter_get_offset(&start_iter);
 
        /* parse for clickable parts, and build a list of begin and end positions  */
-       for (walk = mybuf, n = 0;;) {
+       for (walk = mybuf;;) {
                gint last_index = PARSE_ELEMS;
                gchar *scanpos = NULL;