aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-08-25 02:29:15 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-08-25 02:29:15 +0800
commit68a61c2f072020a3a594ee7246140fd61655bada (patch)
tree5a079921407d28cce1db99d747c67ca11b4a34e7 /mail/mail-config.c
parent5461762966047b5f482d623a68bc600f8aa44751 (diff)
downloadgsoc2013-evolution-68a61c2f072020a3a594ee7246140fd61655bada.tar.gz
gsoc2013-evolution-68a61c2f072020a3a594ee7246140fd61655bada.tar.zst
gsoc2013-evolution-68a61c2f072020a3a594ee7246140fd61655bada.zip
Don't let the uri be an empty string (how the fuck is this even happening
2001-08-24 Jeffrey Stedfast <fejj@ximian.com> * 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
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c20
1 files changed, 8 insertions, 12 deletions
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;