aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r--mail/mail-config.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c
index 1375a75012..96ee65502f 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -506,10 +506,7 @@ get_service_url (GtkObject *table)
editable = gtk_object_get_data (table, "path_entry");
if (editable) {
char *path = gtk_editable_get_chars (editable, 0, -1);
- /* FIXME. I am a kludge. */
- url->path = g_strdup_printf (
- "%s%s", !strcmp (url->protocol, "imap") ? "/" : "",
- path);
+ url->path = g_strdup_printf ("%s%s", url->host ? "/" : "", path);
g_free (path);
}
@@ -561,8 +558,12 @@ set_service_url (GtkObject *table, char *url_str)
gtk_entry_set_text (GTK_ENTRY (editable), url->host);
editable = gtk_object_get_data (table, "path_entry");
- if (editable && url && url->path && *url->path)
- gtk_entry_set_text (GTK_ENTRY (editable), url->path + 1);
+ if (editable && url && url->path) {
+ if (url->host && *url->path)
+ gtk_entry_set_text (GTK_ENTRY (editable), url->path + 1);
+ else
+ gtk_entry_set_text (GTK_ENTRY (editable), url->path);
+ }
/* How are we gonna do this? */
auth_optionmenu = gtk_object_get_data (table, "auth_optionmenu");