aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-provider.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-03-15 09:59:00 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-03-15 09:59:00 +0800
commit2da82ca26261d3772c9c54d28c3195a7735f169f (patch)
treeba9fa339381859790d0dcbd9405792bbbea02c8a /camel/camel-provider.c
parent005d8c98c33702f8ef47c94e2d7aa22bbceb1ed3 (diff)
downloadgsoc2013-evolution-2da82ca26261d3772c9c54d28c3195a7735f169f.tar
gsoc2013-evolution-2da82ca26261d3772c9c54d28c3195a7735f169f.tar.gz
gsoc2013-evolution-2da82ca26261d3772c9c54d28c3195a7735f169f.tar.bz2
gsoc2013-evolution-2da82ca26261d3772c9c54d28c3195a7735f169f.tar.lz
gsoc2013-evolution-2da82ca26261d3772c9c54d28c3195a7735f169f.tar.xz
gsoc2013-evolution-2da82ca26261d3772c9c54d28c3195a7735f169f.tar.zst
gsoc2013-evolution-2da82ca26261d3772c9c54d28c3195a7735f169f.zip
So it turns out that NSS_Init *isn't* idempotent, so we have to protect
2001-03-14 Jeffrey Stedfast <fejj@ximian.com> * camel.c (camel_init): So it turns out that NSS_Init *isn't* idempotent, so we have to protect against initializing it more than once(contrary to what their design specs suggest). * camel-session.c (camel_session_get_service): Use camel_exception_is_set() - Makes no difference but it's more consistant with how we normally do it. * camel-provider.h (CAMEL_URL_ALLOW_SSL): We don't need this. * providers/imap/camel-imap-provider.c: Define the imaps provider. (camel_provider_module_init): Register the imaps provider. * camel-provider.c (camel_provider_init): Only add the protocol to the hash table if it's non empty. Also, g_strdup() the filename into the hash table. * providers/imap/camel-imap-store.c (camel_imap_store_init): Eek! So the service's URL isn't set until after this is initialized. This means we can't check for SSL here. (imap_connect): Set the SSL options here instead. svn path=/trunk/; revision=8718
Diffstat (limited to 'camel/camel-provider.c')
-rw-r--r--camel/camel-provider.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/camel/camel-provider.c b/camel/camel-provider.c
index 03be7cdf1e..4549445842 100644
--- a/camel/camel-provider.c
+++ b/camel/camel-provider.c
@@ -61,8 +61,7 @@ camel_provider_init (void)
DIR *dir;
struct dirent *d;
char *p, *name, buf[80];
- FILE *f;
-
+
providers = g_hash_table_new (g_strcase_hash, g_strcase_equal);
dir = opendir (CAMEL_PROVIDERDIR);
@@ -73,30 +72,35 @@ camel_provider_init (void)
}
while ((d = readdir (dir))) {
+ FILE *fp;
+
p = strchr (d->d_name, '.');
if (!p || strcmp (p, ".urls") != 0)
continue;
name = g_strdup_printf ("%s/%s", CAMEL_PROVIDERDIR, d->d_name);
- f = fopen (name, "r");
- if (!f) {
+ fp = fopen (name, "r");
+ if (!fp) {
g_warning ("Could not read provider info file %s: %s",
name, g_strerror (errno));
g_free (name);
continue;
}
-
+
p = strrchr (name, '.');
strcpy (p, ".so");
- while ((fgets (buf, sizeof (buf), f))) {
+ while ((fgets (buf, sizeof (buf), fp))) {
buf[sizeof (buf) - 1] = '\0';
p = strchr (buf, '\n');
if (p)
*p = '\0';
-
- g_hash_table_insert (providers, g_strdup (buf), name);
+
+ if (*buf)
+ g_hash_table_insert (providers, g_strdup (buf), g_strdup (name));
}
- fclose (f);
+
+ g_free (name);
+ fclose (fp);
}
closedir (dir);