# HG changeset patch # User Christian Hammond # Date 1059616639 0 # Node ID f63da9023c99e26bbed1726c25b9a4e8224ef9bc # Parent 46355beb6c30687f942f746b77bdf7005926cca8 [gaim-migrate @ 6843] Empty proxy information should no longer be able to be set. They get turned into NULLs, as they should. committer: Tailor Script diff -r 46355beb6c30 -r f63da9023c99 src/gtkaccount.c --- a/src/gtkaccount.c Wed Jul 30 15:18:51 2003 +0000 +++ b/src/gtkaccount.c Thu Jul 31 01:57:19 2003 +0000 @@ -1034,32 +1034,48 @@ gaim_account_set_proxy_info(dialog->account, NULL); } else { - const char *port_str; - proxy_info = gaim_account_get_proxy_info(dialog->account); + /* Create the proxy info if it doesn't exist. */ if (proxy_info == NULL) { proxy_info = gaim_proxy_info_new(); gaim_account_set_proxy_info(dialog->account, proxy_info); } + /* Set the proxy info type. */ gaim_proxy_info_set_type(proxy_info, dialog->new_proxy_type); - gaim_proxy_info_set_host(proxy_info, - gtk_entry_get_text(GTK_ENTRY(dialog->proxy_host_entry))); + /* Host */ + value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_host_entry)); - port_str = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_port_entry)); + if (*value != '\0') + gaim_proxy_info_set_host(proxy_info, value); + else + gaim_proxy_info_set_host(proxy_info, NULL); - if (port_str != NULL) - gaim_proxy_info_set_port(proxy_info, atoi(port_str)); + /* Port */ + value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_port_entry)); + + if (*value != '\0') + gaim_proxy_info_set_port(proxy_info, atoi(value)); else gaim_proxy_info_set_port(proxy_info, 0); - gaim_proxy_info_set_username(proxy_info, - gtk_entry_get_text(GTK_ENTRY(dialog->proxy_user_entry))); + /* Username */ + value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_user_entry)); + + if (*value != '\0') + gaim_proxy_info_set_username(proxy_info, value); + else + gaim_proxy_info_set_username(proxy_info, NULL); - gaim_proxy_info_set_password(proxy_info, - gtk_entry_get_text(GTK_ENTRY(dialog->proxy_pass_entry))); + /* Password */ + value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_pass_entry)); + + if (*value != '\0') + gaim_proxy_info_set_password(proxy_info, value); + else + gaim_proxy_info_set_password(proxy_info, NULL); } /* Adds the account to the list, or modify the existing entry. */