aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mail/ChangeLog8
-rw-r--r--mail/mail-config.c13
2 files changed, 15 insertions, 6 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 18ad0d1af8..d26439f1f2 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,11 @@
+2000-07-27 Jeffrey Stedfast <fejj@helixcode.com>
+
+ * mail-config.c: Lets fix Dan's kludge the Right Way (tm)
+ (set_service_url): Only strip off the leading "/" from the
+ url->path if url->host is NULL
+ (get_service_url): Only prepend a leading "/" to the path if the
+ host is NULL
+
2000-07-27 Dan Winship <danw@helixcode.com>
* mail-config.c (get_service_url): toss in a kludge to deal with
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");