dovecot-2.1: Use t_strsplit_tab() wherever possible

dovecot at dovecot.org dovecot at dovecot.org
Thu Apr 19 23:07:07 EEST 2012


details:   http://hg.dovecot.org/dovecot-2.1/rev/fc8031c5e691
changeset: 14435:fc8031c5e691
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Apr 19 23:06:55 2012 +0300
description:
Use t_strsplit_tab() wherever possible

diffstat:

 src/anvil/anvil-connection.c             |   2 +-
 src/auth/auth-master-connection.c        |   6 +++---
 src/auth/auth-request-handler.c          |   4 ++--
 src/auth/auth-stream.c                   |   2 +-
 src/auth/auth-worker-client.c            |   2 +-
 src/auth/db-checkpassword.c              |   2 +-
 src/auth/passdb-blocking.c               |   2 +-
 src/auth/passdb-cache.c                  |   4 ++--
 src/config/config-connection.c           |   2 +-
 src/dict/dict-commands.c                 |   8 ++++----
 src/director/director-connection.c       |   2 +-
 src/director/director-test.c             |   2 +-
 src/director/doveadm-connection.c        |   4 ++--
 src/director/login-connection.c          |   2 +-
 src/doveadm/doveadm-director.c           |  10 +++++-----
 src/doveadm/doveadm-penalty.c            |   2 +-
 src/doveadm/doveadm-proxy.c              |   2 +-
 src/doveadm/doveadm-who.c                |   2 +-
 src/ipc/ipc-connection.c                 |   2 +-
 src/lib-auth/auth-master.c               |   4 ++--
 src/lib-auth/auth-server-connection.c    |   2 +-
 src/lib-master/master-login-auth.c       |   4 ++--
 src/lib-master/master-login.c            |   2 +-
 src/lib-master/master-service-settings.c |   2 +-
 src/login-common/login-proxy.c           |   2 +-
 src/util/script-login.c                  |   2 +-
 26 files changed, 40 insertions(+), 40 deletions(-)

diffs (truncated from 438 to 300 lines):

diff -r 7eb9688c266f -r fc8031c5e691 src/anvil/anvil-connection.c
--- a/src/anvil/anvil-connection.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/anvil/anvil-connection.c	Thu Apr 19 23:06:55 2012 +0300
@@ -40,7 +40,7 @@
 	const char *line;
 
 	line = i_stream_next_line(conn->input);
-	return line == NULL ? NULL : t_strsplit(line, "\t");
+	return line == NULL ? NULL : t_strsplit_tab(line);
 }
 
 static int
diff -r 7eb9688c266f -r fc8031c5e691 src/auth/auth-master-connection.c
--- a/src/auth/auth-master-connection.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/auth/auth-master-connection.c	Thu Apr 19 23:06:55 2012 +0300
@@ -100,7 +100,7 @@
 	buffer_t buf;
 
 	/* <id> <client-pid> <client-id> <cookie> */
-	list = t_strsplit(args, "\t");
+	list = t_strsplit_tab(args);
 	if (str_array_length(list) < 4 ||
 	    str_to_uint(list[0], &id) < 0 ||
 	    str_to_uint(list[1], &client_pid) < 0 ||
@@ -146,7 +146,7 @@
 	unsigned int id;
 
 	/* <id> <userid> [<parameters>] */
-	list = t_strsplit(args, "\t");
+	list = t_strsplit_tab(args);
 	if (list[0] == NULL || list[1] == NULL ||
 	    str_to_uint(list[0], &id) < 0) {
 		i_error("BUG: Master sent broken %s", cmd);
@@ -485,7 +485,7 @@
 	unsigned int id;
 
 	/* <id> [<parameters>] */
-	list = t_strsplit(args, "\t");
+	list = t_strsplit_tab(args);
 	if (list[0] == NULL || str_to_uint(list[0], &id) < 0) {
 		i_error("BUG: Master sent broken LIST");
 		return -1;
diff -r 7eb9688c266f -r fc8031c5e691 src/auth/auth-request-handler.c
--- a/src/auth/auth-request-handler.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/auth/auth-request-handler.c	Thu Apr 19 23:06:55 2012 +0300
@@ -170,7 +170,7 @@
 		}
 	}
 
-	fields = t_strsplit(extra_fields, "\t");
+	fields = t_strsplit_tab(extra_fields);
 	for (src = 0; fields[src] != NULL; src++) {
 		if (strncmp(fields[src], "userdb_", 7) != 0) {
 			if (!seen_pass && strncmp(fields[src], "pass=", 5) == 0)
@@ -439,7 +439,7 @@
 	i_assert(!handler->destroyed);
 
 	/* <id> <mechanism> [...] */
-	list = t_strsplit(args, "\t");
+	list = t_strsplit_tab(args);
 	if (list[0] == NULL || list[1] == NULL ||
 	    str_to_uint(list[0], &id) < 0) {
 		i_error("BUG: Authentication client %u "
diff -r 7eb9688c266f -r fc8031c5e691 src/auth/auth-stream.c
--- a/src/auth/auth-stream.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/auth/auth-stream.c	Thu Apr 19 23:06:55 2012 +0300
@@ -140,7 +140,7 @@
 
 const char *const *auth_stream_split(struct auth_stream_reply *reply)
 {
-	return t_strsplit(str_c(reply->str), "\t");
+	return t_strsplit_tab(str_c(reply->str));
 }
 
 string_t *auth_stream_reply_get_str(struct auth_stream_reply *reply)
diff -r 7eb9688c266f -r fc8031c5e691 src/auth/auth-worker-client.c
--- a/src/auth/auth-worker-client.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/auth/auth-worker-client.c	Thu Apr 19 23:06:55 2012 +0300
@@ -547,7 +547,7 @@
 	unsigned int id;
 	bool ret = FALSE;
 
-	args = t_strsplit(line, "\t");
+	args = t_strsplit_tab(line);
 	if (args[0] == NULL || args[1] == NULL || args[2] == NULL ||
 	    str_to_uint(args[0], &id) < 0) {
 		i_error("BUG: Invalid input: %s", line);
diff -r 7eb9688c266f -r fc8031c5e691 src/auth/db-checkpassword.c
--- a/src/auth/db-checkpassword.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/auth/db-checkpassword.c	Thu Apr 19 23:06:55 2012 +0300
@@ -54,7 +54,7 @@
 	const char *const *tmp;
 	const char *key, *p;
 
-	for (tmp = t_strsplit(extra_fields, "\t"); *tmp != NULL; tmp++) {
+	for (tmp = t_strsplit_tab(extra_fields); *tmp != NULL; tmp++) {
 		key = t_str_ucase(t_strcut(*tmp, '='));
 		p = strchr(*tmp, '=');
 		if (p == NULL)
diff -r 7eb9688c266f -r fc8031c5e691 src/auth/passdb-blocking.c
--- a/src/auth/passdb-blocking.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/auth/passdb-blocking.c	Thu Apr 19 23:06:55 2012 +0300
@@ -30,7 +30,7 @@
 	enum passdb_result ret;
 	const char *const *args;
 
-	args = t_strsplit(reply, "\t");
+	args = t_strsplit_tab(reply);
 
 	if (strcmp(*args, "OK") == 0 && args[1] != NULL && args[2] != NULL) {
 		/* OK \t user \t password [\t extra] */
diff -r 7eb9688c266f -r fc8031c5e691 src/auth/passdb-cache.c
--- a/src/auth/passdb-cache.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/auth/passdb-cache.c	Thu Apr 19 23:06:55 2012 +0300
@@ -53,7 +53,7 @@
 		return TRUE;
 	}
 
-	list = t_strsplit(value, "\t");
+	list = t_strsplit_tab(value);
 
 	cached_pw = list[0];
 	if (*cached_pw == '\0') {
@@ -117,7 +117,7 @@
 		return TRUE;
 	}
 
-	list = t_strsplit(value, "\t");
+	list = t_strsplit_tab(value);
 	auth_request_set_fields(request, list + 1, NULL);
 
 	*result_r = PASSDB_RESULT_OK;
diff -r 7eb9688c266f -r fc8031c5e691 src/config/config-connection.c
--- a/src/config/config-connection.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/config/config-connection.c	Thu Apr 19 23:06:55 2012 +0300
@@ -42,7 +42,7 @@
 	if (line == NULL)
 		return NULL;
 
-	return t_strsplit(line, "\t");
+	return t_strsplit_tab(line);
 }
 
 static void
diff -r 7eb9688c266f -r fc8031c5e691 src/dict/dict-commands.c
--- a/src/dict/dict-commands.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/dict/dict-commands.c	Thu Apr 19 23:06:55 2012 +0300
@@ -90,7 +90,7 @@
 		return -1;
 	}
 
-	args = t_strsplit(line, "\t");
+	args = t_strsplit_tab(line);
 	if (str_array_length(args) < 2 ||
 	    str_to_uint(args[0], &flags) < 0) {
 		i_error("dict client: ITERATE: broken input");
@@ -272,7 +272,7 @@
 	const char *const *args;
 
 	/* <id> <key> <value> */
-	args = t_strsplit(line, "\t");
+	args = t_strsplit_tab(line);
 	if (str_array_length(args) != 3) {
 		i_error("dict client: SET: broken input");
 		return -1;
@@ -291,7 +291,7 @@
 	const char *const *args;
 
 	/* <id> <key> */
-	args = t_strsplit(line, "\t");
+	args = t_strsplit_tab(line);
 	if (str_array_length(args) != 2) {
 		i_error("dict client: UNSET: broken input");
 		return -1;
@@ -311,7 +311,7 @@
 	long long diff;
 
 	/* <id> <key> <diff> */
-	args = t_strsplit(line, "\t");
+	args = t_strsplit_tab(line);
 	if (str_array_length(args) != 3 ||
 	    str_to_llong(args[2], &diff) < 0) {
 		i_error("dict client: ATOMIC_INC: broken input");
diff -r 7eb9688c266f -r fc8031c5e691 src/director/director-connection.c
--- a/src/director/director-connection.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/director/director-connection.c	Thu Apr 19 23:06:55 2012 +0300
@@ -1169,7 +1169,7 @@
 	const char *cmd, *const *args;
 	bool ret;
 
-	args = t_strsplit(line, "\t");
+	args = t_strsplit_tab(line);
 	cmd = args[0]; args++;
 	if (cmd == NULL) {
 		i_error("director(%s): Received empty line", conn->name);
diff -r 7eb9688c266f -r fc8031c5e691 src/director/director-test.c
--- a/src/director/director-test.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/director/director-test.c	Thu Apr 19 23:06:55 2012 +0300
@@ -492,7 +492,7 @@
 			break;
 		/* ip vhost-count user-count */
 		T_BEGIN {
-			const char *const *args = t_strsplit(line, "\t");
+			const char *const *args = t_strsplit_tab(line);
 			struct host *host;
 
 			host = i_new(struct host, 1);
diff -r 7eb9688c266f -r fc8031c5e691 src/director/doveadm-connection.c
--- a/src/director/doveadm-connection.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/director/doveadm-connection.c	Thu Apr 19 23:06:55 2012 +0300
@@ -137,7 +137,7 @@
 	struct ip_addr ip;
 	unsigned int vhost_count = -1U;
 
-	args = t_strsplit(line, "\t");
+	args = t_strsplit_tab(line);
 	if (args[0] == NULL ||
 	    net_addr2ip(args[0], &ip) < 0 ||
 	    (args[1] != NULL && str_to_uint(args[1], &vhost_count) < 0)) {
@@ -300,7 +300,7 @@
 	struct mail_host *host;
 	struct ip_addr ip;
 
-	args = t_strsplit(line, "\t");
+	args = t_strsplit_tab(line);
 	if (args[0] == NULL || args[1] == NULL ||
 	    net_addr2ip(args[1], &ip) < 0) {
 		i_error("doveadm sent invalid USER-MOVE parameters: %s", line);
diff -r 7eb9688c266f -r fc8031c5e691 src/director/login-connection.c
--- a/src/director/login-connection.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/director/login-connection.c	Thu Apr 19 23:06:55 2012 +0300
@@ -121,7 +121,7 @@
 	}
 
 	/* OK <id> [<parameters>] */
-	args = t_strsplit(line_params, "\t");
+	args = t_strsplit_tab(line_params);
 	if (*args != NULL) {
 		/* we should always get here, but in case we don't just
 		   forward as-is and let login process handle the error. */
diff -r 7eb9688c266f -r fc8031c5e691 src/doveadm/doveadm-director.c
--- a/src/doveadm/doveadm-director.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/doveadm/doveadm-director.c	Thu Apr 19 23:06:55 2012 +0300
@@ -120,7 +120,7 @@
 		return;
 	}
 
-	args = t_strsplit(line, "\t");
+	args = t_strsplit_tab(line);
 	if (str_array_length(args) != 4 ||
 	    str_to_uint(args[1], &expires) < 0) {
 		i_error("Invalid reply from director");
@@ -162,7 +162,7 @@
 		if (*line == '\0')
 			break;
 		T_BEGIN {
-			args = t_strsplit(line, "\t");
+			args = t_strsplit_tab(line);
 			if (str_array_length(args) >= 3) {
 				doveadm_print(args[0]);
 				doveadm_print(args[1]);
@@ -315,7 +315,7 @@
 		if (*line == '\0')
 			break;
 		T_BEGIN {
-			args = t_strsplit(line, "\t");
+			args = t_strsplit_tab(line);
 			if (str_array_length(args) < 3 ||
 			    str_to_uint(args[0], &user_hash) < 0 ||
 			    str_to_uint(args[1], &expires) < 0 ||
@@ -559,7 +559,7 @@
 		if (*line == '\0')
 			break;
 		T_BEGIN {
-			args = t_strsplit(line, "\t");
+			args = t_strsplit_tab(line);
 			if (str_array_length(args) >= 2) {
 				director_dump_cmd(ctx, "add", "%s %s",
 						  args[0], args[1]);
@@ -599,7 +599,7 @@
 		if (*line == '\0')
 			break;
 		T_BEGIN {
-			args = t_strsplit(line, "\t");
+			args = t_strsplit_tab(line);
 			if (str_array_length(args) >= 4 &&
 			    str_to_ulong(args[3], &l) == 0) {
 				doveadm_print(args[0]);
diff -r 7eb9688c266f -r fc8031c5e691 src/doveadm/doveadm-penalty.c
--- a/src/doveadm/doveadm-penalty.c	Thu Apr 19 23:00:16 2012 +0300
+++ b/src/doveadm/doveadm-penalty.c	Thu Apr 19 23:06:55 2012 +0300
@@ -27,7 +27,7 @@
 
 static void penalty_parse_line(const char *line, struct penalty_line *line_r)
 {
-	const char *const *args = t_strsplit(line, "\t");
+	const char *const *args = t_strsplit_tab(line);
 	const char *ident = args[0];
 	const char *penalty_str = args[1];
 	const char *last_penalty_str = args[2];


More information about the dovecot-cvs mailing list