changeset 5792:d89cadcafbec

[gaim-migrate @ 6217] Empty data between tags are now considered NULL. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sat, 07 Jun 2003 06:09:02 +0000
parents f5a4a17c58a5
children 952710ac6635
files src/account.c
diffstat 1 files changed, 35 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/src/account.c	Sat Jun 07 05:53:57 2003 +0000
+++ b/src/account.c	Sat Jun 07 06:09:02 2003 +0000
@@ -831,12 +831,14 @@
 		}
 	}
 	else if (data->tag == TAG_PASSWORD) {
-		if (data->in_proxy) {
-			gaim_proxy_info_set_password(data->proxy_info, buffer);
-		}
-		else {
-			gaim_account_set_password(data->account, buffer);
-			gaim_account_set_remember_password(data->account, TRUE);
+		if (strcmp(buffer, "")) {
+			if (data->in_proxy) {
+				gaim_proxy_info_set_password(data->proxy_info, buffer);
+			}
+			else {
+				gaim_account_set_password(data->account, buffer);
+				gaim_account_set_remember_password(data->account, TRUE);
+			}
 		}
 	}
 	else if (data->tag == TAG_ALIAS)
@@ -864,38 +866,38 @@
 		}
 	}
 	else if (data->tag == TAG_HOST) {
-		if (data->in_proxy) {
+		if (data->in_proxy && strcmp(buffer, ""))
 			gaim_proxy_info_set_host(data->proxy_info, buffer);
-		}
 	}
 	else if (data->tag == TAG_PORT) {
-		if (data->in_proxy) {
+		if (data->in_proxy && strcmp(buffer, ""))
 			gaim_proxy_info_set_port(data->proxy_info, atoi(buffer));
-		}
 	}
 	else if (data->tag == TAG_SETTING) {
-		if (data->setting_ui != NULL) {
-			if (data->setting_type == GAIM_PREF_STRING)
-				gaim_account_set_ui_string(data->account, data->setting_ui,
-										   data->setting_name, buffer);
-			else if (data->setting_type == GAIM_PREF_INT)
-				gaim_account_set_ui_int(data->account, data->setting_ui,
-										data->setting_name, atoi(buffer));
-			else if (data->setting_type == GAIM_PREF_BOOLEAN)
-				gaim_account_set_ui_bool(data->account, data->setting_ui,
-										 data->setting_name,
-										 (*buffer == '0' ? FALSE : TRUE));
-		}
-		else {
-			if (data->setting_type == GAIM_PREF_STRING)
-				gaim_account_set_string(data->account, data->setting_name,
-										buffer);
-			else if (data->setting_type == GAIM_PREF_INT)
-				gaim_account_set_int(data->account, data->setting_name,
-									 atoi(buffer));
-			else if (data->setting_type == GAIM_PREF_BOOLEAN)
-				gaim_account_set_bool(data->account, data->setting_name,
-									  (*buffer == '0' ? FALSE : TRUE));
+		if (strcmp(buffer, "")) {
+			if (data->setting_ui != NULL) {
+				if (data->setting_type == GAIM_PREF_STRING)
+					gaim_account_set_ui_string(data->account, data->setting_ui,
+											   data->setting_name, buffer);
+				else if (data->setting_type == GAIM_PREF_INT)
+					gaim_account_set_ui_int(data->account, data->setting_ui,
+											data->setting_name, atoi(buffer));
+				else if (data->setting_type == GAIM_PREF_BOOLEAN)
+					gaim_account_set_ui_bool(data->account, data->setting_ui,
+											 data->setting_name,
+											 (*buffer == '0' ? FALSE : TRUE));
+			}
+			else {
+				if (data->setting_type == GAIM_PREF_STRING)
+					gaim_account_set_string(data->account, data->setting_name,
+											buffer);
+				else if (data->setting_type == GAIM_PREF_INT)
+					gaim_account_set_int(data->account, data->setting_name,
+										 atoi(buffer));
+				else if (data->setting_type == GAIM_PREF_BOOLEAN)
+					gaim_account_set_bool(data->account, data->setting_name,
+										  (*buffer == '0' ? FALSE : TRUE));
+			}
 		}
 
 		g_free(data->setting_name);
@@ -908,7 +910,7 @@
 			gaim_proxy_info_destroy(data->proxy_info);
 			data->proxy_info = NULL;
 		}
-		else {
+		else if (strcmp(buffer, "")) {
 			gaim_account_set_proxy_info(data->account, data->proxy_info);
 		}
 	}