From: Tristan Chabredier Date: Mon, 13 Aug 2007 21:36:57 +0000 (+0000) Subject: 2007-08-13 [wwp] 2.10.0cvs119 X-Git-Tag: rel_3_0_0~74 X-Git-Url: http://git.claws-mail.org/?p=claws.git;a=commitdiff_plain;h=e1cfe6213a005eefab2089287a6b3852b0ad1bdc 2007-08-13 [wwp] 2.10.0cvs119 * src/addr_compl.c * src/addressbook.c * src/addrindex.c * src/compose.c * src/filtering.c * src/folderview.c * src/inc.c * src/matcher.c * src/mh.c * src/partial_download.c * src/prefs_gtk.c * src/procmsg.c * src/stock_pixmap.c * src/summaryview.c * src/common/utils.c * src/gtk/gtkaspell.c * src/gtk/menu.c Make sure we never pass NULL pointers for %s substitutions (prevent from crashing in Windows). --- diff --git a/ChangeLog b/ChangeLog index f266f56e2..ed66c534e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2007-08-13 [wwp] 2.10.0cvs119 + + * src/addr_compl.c + * src/addressbook.c + * src/addrindex.c + * src/compose.c + * src/filtering.c + * src/folderview.c + * src/inc.c + * src/matcher.c + * src/mh.c + * src/partial_download.c + * src/prefs_gtk.c + * src/procmsg.c + * src/stock_pixmap.c + * src/summaryview.c + * src/common/utils.c + * src/gtk/gtkaspell.c + * src/gtk/menu.c + Make sure we never pass NULL pointers for %s substitutions + (prevent from crashing in Windows). + 2007-08-13 [wwp] 2.10.0cvs118 * src/msgcache.c diff --git a/PATCHSETS b/PATCHSETS index 434925521..316a10b5f 100644 --- a/PATCHSETS +++ b/PATCHSETS @@ -2773,3 +2773,4 @@ ( cvs diff -u -r 1.1.2.25 -r 1.1.2.26 src/plugins/pgpcore/prefs_gpg.c; ) > 2.10.0cvs116.patchset ( cvs diff -u -r 1.36.2.107 -r 1.36.2.108 src/common/utils.c; ) > 2.10.0cvs117.patchset ( cvs diff -u -r 1.16.2.57 -r 1.16.2.58 src/msgcache.c; ) > 2.10.0cvs118.patchset +( cvs diff -u -r 1.27.2.38 -r 1.27.2.39 src/addr_compl.c; cvs diff -u -r 1.60.2.93 -r 1.60.2.94 src/addressbook.c; cvs diff -u -r 1.28.2.28 -r 1.28.2.29 src/addrindex.c; cvs diff -u -r 1.382.2.400 -r 1.382.2.401 src/compose.c; cvs diff -u -r 1.60.2.36 -r 1.60.2.37 src/filtering.c; cvs diff -u -r 1.207.2.173 -r 1.207.2.174 src/folderview.c; cvs diff -u -r 1.149.2.78 -r 1.149.2.79 src/inc.c; cvs diff -u -r 1.75.2.45 -r 1.75.2.46 src/matcher.c; cvs diff -u -r 1.79.2.59 -r 1.79.2.60 src/mh.c; cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/partial_download.c; cvs diff -u -r 1.10.2.33 -r 1.10.2.34 src/prefs_gtk.c; cvs diff -u -r 1.150.2.101 -r 1.150.2.102 src/procmsg.c; cvs diff -u -r 1.25.2.45 -r 1.25.2.46 src/stock_pixmap.c; cvs diff -u -r 1.395.2.318 -r 1.395.2.319 src/summaryview.c; cvs diff -u -r 1.36.2.108 -r 1.36.2.109 src/common/utils.c; cvs diff -u -r 1.9.2.52 -r 1.9.2.53 src/gtk/gtkaspell.c; cvs diff -u -r 1.5.2.23 -r 1.5.2.24 src/gtk/menu.c; ) > 2.10.0cvs119.patchset diff --git a/configure.ac b/configure.ac index 16b794b3f..54534c215 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ MINOR_VERSION=10 MICRO_VERSION=0 INTERFACE_AGE=0 BINARY_AGE=0 -EXTRA_VERSION=118 +EXTRA_VERSION=119 EXTRA_RELEASE= EXTRA_GTK2_VERSION= diff --git a/src/addr_compl.c b/src/addr_compl.c index 4365606ae..ca17e1e5e 100644 --- a/src/addr_compl.c +++ b/src/addr_compl.c @@ -371,7 +371,7 @@ gint start_address_completion(gchar *folderpath) g_ref_count++; debug_print("start_address_completion(%s) ref count %d\n", - folderpath, g_ref_count); + folderpath?folderpath:"(null)", g_ref_count); return g_list_length(g_completion_list); } diff --git a/src/addressbook.c b/src/addressbook.c index 27b4edf77..cd322c43d 100644 --- a/src/addressbook.c +++ b/src/addressbook.c @@ -4919,7 +4919,7 @@ gboolean addressbook_folder_selection( gchar **folderpath ) } else { *folderpath = g_strdup_printf("%s", book->fileName); } - debug_print( "addressbook_foldersel: %s\n", *folderpath); + debug_print( "addressbook_foldersel: %s\n", *folderpath?*folderpath:"(null)"); return (*folderpath != NULL); } return FALSE; diff --git a/src/addrindex.c b/src/addrindex.c index 3c4e12b45..e8fac836a 100644 --- a/src/addrindex.c +++ b/src/addrindex.c @@ -2916,7 +2916,7 @@ gboolean addrindex_load_completion( AddressBookFile *abf = book->rawDataSource; - debug_print("addrindex_load_completion: book %p '%s'\n", book, abf->fileName); + debug_print("addrindex_load_completion: book %p '%s'\n", book, abf?abf->fileName:"(null)"); addrindex_load_completion_load_persons( callBackFunc, book ); diff --git a/src/common/utils.c b/src/common/utils.c index 3724dca1e..57949b567 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -3467,7 +3467,7 @@ gint execute_command_line(const gchar *cmdline, gboolean async) gchar **argv; gint ret; - debug_print("execute_command_line(): executing: %s\n", cmdline); + debug_print("execute_command_line(): executing: %s\n", cmdline?cmdline:"(null)"); argv = strsplit_with_quote(cmdline, " ", 0); diff --git a/src/compose.c b/src/compose.c index 20bb29103..6d7a11f5e 100644 --- a/src/compose.c +++ b/src/compose.c @@ -8557,7 +8557,7 @@ gboolean compose_draft (gpointer data, guint action) path = folder_item_fetch_msg(draft, msgnum); if (path == NULL) { - debug_print("can't fetch %s:%d\n",draft->path, msgnum); + debug_print("can't fetch %s:%d\n", draft->path, msgnum); goto unlock; } if (g_stat(path, &s) < 0) { diff --git a/src/filtering.c b/src/filtering.c index fc46d0064..6fa698dec 100644 --- a/src/filtering.c +++ b/src/filtering.c @@ -57,7 +57,7 @@ static inline gint strlen_with_check(const gchar *expr, gint fline, const gchar if (str) return strlen(str); else { - debug_print("%s(%d) - invalid string %s\n", __FILE__, fline, expr); + debug_print("%s(%d) - invalid string %s\n", __FILE__, fline, expr?expr:"(null)"); return 0; } } @@ -274,7 +274,7 @@ static gboolean filteringaction_apply(FilteringAction * action, MsgInfo * info) folder_find_item_from_identifier(action->destination); if (!dest_folder) { debug_print("*** folder not found '%s'\n", - action->destination ?action->destination :""); + action->destination ?action->destination :"(null)"); return FALSE; } @@ -296,7 +296,7 @@ static gboolean filteringaction_apply(FilteringAction * action, MsgInfo * info) if (!dest_folder) { debug_print("*** folder not found '%s'\n", - action->destination ?action->destination :""); + action->destination ?action->destination :"(null)"); return FALSE; } @@ -317,7 +317,7 @@ static gboolean filteringaction_apply(FilteringAction * action, MsgInfo * info) val = tags_get_id_for_str(action->destination); if (val == -1) { debug_print("*** tag '%s' not found\n", - action->destination ?action->destination :""); + action->destination ?action->destination :"(null)"); return FALSE; } diff --git a/src/folderview.c b/src/folderview.c index 302d94870..8b181701d 100644 --- a/src/folderview.c +++ b/src/folderview.c @@ -2193,6 +2193,7 @@ static void folderview_selected(GtkCTree *ctree, GtkCTreeNode *row, } /* Open Folder */ + /* TODO: wwp: avoid displaying (null) in the status bar */ buf = g_strdup_printf(_("Opening Folder %s..."), item->path ? item->path : "(null)"); debug_print("%s\n", buf); diff --git a/src/gtk/gtkaspell.c b/src/gtk/gtkaspell.c index 77104d309..33c47c3c8 100644 --- a/src/gtk/gtkaspell.c +++ b/src/gtk/gtkaspell.c @@ -1699,7 +1699,7 @@ static GSList *gtkaspell_get_dictionary_list(const gchar *aspell_path, gint refr dlist = get_aspell_dict_info_list(config); delete_aspell_config(config); - debug_print("Aspell: checking for dictionaries in %s\n", aspell_path); + debug_print("Aspell: checking for dictionaries in %s\n", aspell_path?aspell_path:"(null)"); dels = aspell_dict_info_list_elements(dlist); while ( (entry = aspell_dict_info_enumeration_next(dels)) != 0) { diff --git a/src/gtk/menu.c b/src/gtk/menu.c index d75071b6c..67223d0b0 100644 --- a/src/gtk/menu.c +++ b/src/gtk/menu.c @@ -135,7 +135,7 @@ void menu_set_active(GtkItemFactory *ifactory, const gchar *path, g_return_if_fail(widget != NULL); if (!GTK_IS_CHECK_MENU_ITEM(widget)) { - debug_print("%s not check_menu_item\n", path); + debug_print("%s not check_menu_item\n", path?path:"(null)"); return; } gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(widget), is_active); diff --git a/src/inc.c b/src/inc.c index ae8a1b2e4..cfda7b8c9 100644 --- a/src/inc.c +++ b/src/inc.c @@ -1282,17 +1282,22 @@ static gint inc_spool_account(PrefsAccount *account) } else inbox = folder_get_default_inbox(); - if (is_file_exist(account->local_mbox)) - mbox = g_strdup(account->local_mbox); - else if (is_dir_exist(account->local_mbox)) - mbox = g_strconcat(account->local_mbox, G_DIR_SEPARATOR_S, - g_get_user_name(), NULL); - else { - debug_print("%s: local mailbox not found.\n", - account->local_mbox); + if (account->local_mbox) { + if (is_file_exist(account->local_mbox)) + mbox = g_strdup(account->local_mbox); + else if (is_dir_exist(account->local_mbox)) + mbox = g_strconcat(account->local_mbox, G_DIR_SEPARATOR_S, + g_get_user_name(), NULL); + else { + debug_print("%s: local mailbox not found.\n", + account->local_mbox); + return -1; + } + } else { + debug_print("local mailbox not set in account info.\n"); return -1; - } - + } + result = get_spool(inbox, mbox, account); g_free(mbox); diff --git a/src/matcher.c b/src/matcher.c index f25d61c80..2b0b67300 100644 --- a/src/matcher.c +++ b/src/matcher.c @@ -317,7 +317,7 @@ static gboolean match_with_addresses_in_addressbook g_return_val_if_fail(address_list != NULL, FALSE); debug_print("match_with_addresses_in_addressbook(%d, %s)\n", - g_slist_length(address_list), folderpath); + g_slist_length(address_list), folderpath?folderpath:"(null)"); if (folderpath == NULL || strcasecmp(folderpath, _("Any")) == 0 || diff --git a/src/mh.c b/src/mh.c index 000a282e3..37979963b 100644 --- a/src/mh.c +++ b/src/mh.c @@ -218,7 +218,7 @@ gboolean mh_scan_required(Folder *folder, FolderItem *item) if ((s.st_mtime > item->mtime) && (s.st_mtime - 3600 != item->mtime)) { debug_print("MH scan required, folder updated: %s (%ld > %ld)\n", - path, + path?path:"(null)", (long int) s.st_mtime, (long int) item->mtime); g_free(path); @@ -226,7 +226,7 @@ gboolean mh_scan_required(Folder *folder, FolderItem *item) } debug_print("MH scan not required: %s (%ld <= %ld)\n", - path, + path?path:"(null)", (long int) s.st_mtime, (long int) item->mtime); g_free(path); @@ -243,7 +243,7 @@ static void mh_get_last_num(Folder *folder, FolderItem *item) g_return_if_fail(item != NULL); - debug_print("mh_get_last_num(): Scanning %s ...\n", item->path); + debug_print("mh_get_last_num(): Scanning %s ...\n", item->path?item->path:"(null)"); path = folder_item_get_path(item); g_return_if_fail(path != NULL); @@ -269,7 +269,7 @@ static void mh_get_last_num(Folder *folder, FolderItem *item) } closedir(dp); - debug_print("Last number in dir %s = %d\n", item->path, max); + debug_print("Last number in dir %s = %d\n", item->path?item->path:"(null)", max); item->last_num = max; } @@ -283,7 +283,7 @@ gint mh_get_num_list(Folder *folder, FolderItem *item, GSList **list, gboolean * g_return_val_if_fail(item != NULL, -1); - debug_print("mh_get_num_list(): Scanning %s ...\n", item->path); + debug_print("mh_get_num_list(): Scanning %s ...\n", item->path?item->path:"(null)"); *old_uids_valid = TRUE; @@ -997,7 +997,7 @@ static gboolean mh_remove_missing_folder_items_func(GNode *node, gpointer data) path = folder_item_get_path(item); if (!is_dir_exist(path)) { - debug_print("folder '%s' not found. removing...\n", path); + debug_print("folder '%s' not found. removing...\n", path?path:"(null)"); folder_item_remove(item); } g_free(path); @@ -1449,6 +1449,6 @@ void mh_set_mtime(FolderItem *item) } item->mtime = s.st_mtime; - debug_print("MH: forced mtime of %s to %ld\n", item->name, item->mtime); + debug_print("MH: forced mtime of %s to %ld\n", item->name?item->name:"(null)", item->mtime); g_free(path); } diff --git a/src/partial_download.c b/src/partial_download.c index ad38c8496..fac09d129 100644 --- a/src/partial_download.c +++ b/src/partial_download.c @@ -309,7 +309,7 @@ void partial_delete_old(const gchar *file) int num = 0; FolderItem *item = NULL; - debug_print("too big message updated,should remove %s\n", file); + debug_print("too big message updated, should remove %s\n", file?file:"(null)"); if (snum) { snum++; diff --git a/src/prefs_gtk.c b/src/prefs_gtk.c index 7d5aff968..fc194408a 100644 --- a/src/prefs_gtk.c +++ b/src/prefs_gtk.c @@ -1022,7 +1022,7 @@ static int prefs_cache_sections(GHashTable *file_cache, const gchar *rcfile) GHashTable *section_cache = NULL; if (!fp) { - debug_print("cache: %s: %s", rcfile, strerror(errno)); + debug_print("cache: %s: %s", rcfile?rcfile:"(null)", strerror(errno)); return -1; } @@ -1084,7 +1084,7 @@ static int prefs_cache(const gchar *rcfile) GHashTable *file_cache = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, prefs_destroy_file_cache); - debug_print("new file '%s'\n", rcfile); + debug_print("new file '%s'\n", rcfile?rcfile:"(null)"); g_hash_table_insert(whole_cache, g_strdup(rcfile), file_cache); return prefs_cache_sections(file_cache, rcfile); @@ -1145,13 +1145,13 @@ static gboolean prefs_read_config_from_cache(PrefParam *param, const gchar *labe sections_table = g_hash_table_lookup(whole_cache, rcfile); if (sections_table == NULL) { - g_warning("Can't find %s in the whole cache\n", rcfile); + g_warning("Can't find %s in the whole cache\n", rcfile?rcfile:"(null)"); return FALSE; } values_table = g_hash_table_lookup(sections_table, label); if (values_table == NULL) { - debug_print("no '%s' section in '%s' cache\n", label, rcfile); + debug_print("no '%s' section in '%s' cache\n", label?label:"(null)", rcfile?rcfile:"(null)"); return TRUE; } g_hash_table_foreach(values_table, prefs_parse_cache, param); diff --git a/src/procmsg.c b/src/procmsg.c index 4f54ab733..c3e4f2615 100644 --- a/src/procmsg.c +++ b/src/procmsg.c @@ -810,7 +810,7 @@ parse_again: g_slist_free(orig); for (cur = result; cur; cur = cur->next) - debug_print("sort after %s\n", ((MsgInfo *)cur->data)->from); + debug_print("sort after %s\n", ((MsgInfo *)cur->data)->from); debug_print("\n"); diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c index dda4d16c1..11dde53eb 100644 --- a/src/stock_pixmap.c +++ b/src/stock_pixmap.c @@ -502,7 +502,7 @@ static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname) DIR *dp; if ((dp = opendir(dirname)) == NULL) { - debug_print("dir %s not found, skipping theme scan", dirname); + debug_print("dir %s not found, skipping theme scan", dirname?dirname:"(null)"); return; } diff --git a/src/summaryview.c b/src/summaryview.c index b116357a5..741d302d4 100644 --- a/src/summaryview.c +++ b/src/summaryview.c @@ -1177,7 +1177,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item) g_free(buf); debug_print("empty folder (%p %s %p %d)\n\n", item, - item?item->path:"NULL", + (item && item->path)?item->path:"(null)", item?folder_item_parent(item):0x0, item?item->no_select:FALSE); summary_set_hide_read_msgs_menu(summaryview, FALSE);