From 68a61c2f072020a3a594ee7246140fd61655bada Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 24 Aug 2001 18:29:15 +0000 Subject: Don't let the uri be an empty string (how the fuck is this even happening 2001-08-24 Jeffrey Stedfast * mail-config.c (mail_config_set_thread_list): Don't let the uri be an empty string (how the fuck is this even happening in the first place??). (mail_config_get_thread_list): Same. (mail_config_set_show_preview): And here. (mail_config_get_show_preview): And finally here. svn path=/trunk/; revision=12443 --- mail/ChangeLog | 9 +++++++++ mail/mail-config.c | 20 ++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 5fee79adc6..fa8e473540 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2001-08-24 Jeffrey Stedfast + + * mail-config.c (mail_config_set_thread_list): Don't let the uri + be an empty string (how the fuck is this even happening in the + first place??). + (mail_config_get_thread_list): Same. + (mail_config_set_show_preview): And here. + (mail_config_get_show_preview): And finally here. + 2001-08-23 Larry Ewing * mail-search.c (mail_search_construct): attach to the destroy diff --git a/mail/mail-config.c b/mail/mail-config.c index 7c0b4a4c97..89bc55f5ef 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -894,20 +894,16 @@ mail_config_is_configured (void) static char * uri_to_key (const char *uri) { - char *rval; - int i = 0; + char *rval, *ptr; if (!uri) return NULL; rval = g_strdup (uri); - while (rval [i]) { - if (rval [i] == '/' || rval [i] == ':') - rval [i] = '_'; - - i++; - } + for (ptr = rval; *ptr; ptr++) + if (*ptr == '/' || *ptr == ':') + *ptr = '_'; return rval; } @@ -927,7 +923,7 @@ mail_config_set_empty_trash_on_exit (gboolean value) gboolean mail_config_get_show_preview (const char *uri) { - if (uri) { + if (uri && *uri) { gpointer key, val; char *dbkey; @@ -962,7 +958,7 @@ mail_config_get_show_preview (const char *uri) void mail_config_set_show_preview (const char *uri, gboolean value) { - if (uri) { + if (uri && *uri) { char *dbkey = uri_to_key (uri); gpointer key, val; @@ -984,7 +980,7 @@ mail_config_set_show_preview (const char *uri, gboolean value) gboolean mail_config_get_thread_list (const char *uri) { - if (uri) { + if (uri && *uri) { gpointer key, val; char *dbkey; @@ -1019,7 +1015,7 @@ mail_config_get_thread_list (const char *uri) void mail_config_set_thread_list (const char *uri, gboolean value) { - if (uri) { + if (uri && *uri) { char *dbkey = uri_to_key (uri); gpointer key, val; -- cgit v1.2.3