dovecot-2.2-pigeonhole: lib-sieve: Fixed printing of hybrid comm...

pigeonhole at rename-it.nl pigeonhole at rename-it.nl
Wed Dec 17 00:12:56 UTC 2014


details:   http://hg.rename-it.nl/dovecot-2.2-pigeonhole/rev/590407d97ecb
changeset: 1974:590407d97ecb
user:      Stephan Bosch <stephan at rename-it.nl>
date:      Wed Dec 17 00:35:47 2014 +0100
description:
lib-sieve: Fixed printing of hybrid command type.

diffstat:

 src/lib-sieve/sieve-commands.c |  18 ++++++++++++++++++
 src/lib-sieve/sieve-commands.h |   4 ++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diffs (49 lines):

diff -r e7979b6a9d4b -r 590407d97ecb src/lib-sieve/sieve-commands.c
--- a/src/lib-sieve/sieve-commands.c	Sat Nov 22 00:17:13 2014 +0100
+++ b/src/lib-sieve/sieve-commands.c	Wed Dec 17 00:35:47 2014 +0100
@@ -296,6 +296,24 @@
 	case SCT_NONE: return "command of unspecified type (bug)";
 	case SCT_TEST: return "test";
 	case SCT_COMMAND: return "command";
+	case SCT_HYBRID: return "command or test";
+	default:
+		break;
+	}
+	return "??COMMAND-TYPE??";
+}
+
+const char *sieve_command_type_name
+	(const struct sieve_command *cmd)
+{
+	switch ( cmd->def->type ) {
+	case SCT_NONE: return "command of unspecified type (bug)";
+	case SCT_TEST: return "test";
+	case SCT_COMMAND: return "command";
+	case SCT_HYBRID:
+		if ( cmd->ast_node->type == SAT_TEST )
+			return "test";
+		return "command";
 	default:
 		break;
 	}
diff -r e7979b6a9d4b -r 590407d97ecb src/lib-sieve/sieve-commands.h
--- a/src/lib-sieve/sieve-commands.h	Sat Nov 22 00:17:13 2014 +0100
+++ b/src/lib-sieve/sieve-commands.h	Wed Dec 17 00:35:47 2014 +0100
@@ -164,8 +164,6 @@
 	( (cmd)->def == &(definition) )
 #define sieve_command_identifier(cmd) \
 	( (cmd)->def->identifier )
-#define sieve_command_type_name(cmd) \
-	( sieve_command_def_type_name((cmd)->def) )
 
 #define sieve_commands_equal(cmd1, cmd2) \
 	( (cmd1) != NULL && (cmd2) != NULL && (cmd1)->def == (cmd2)->def )
@@ -179,6 +177,8 @@
 
 const char *sieve_command_def_type_name
 	(const struct sieve_command_def *cmd_def);
+const char *sieve_command_type_name
+	(const struct sieve_command *cmd);
 
 struct sieve_command *sieve_command_prev
 	(struct sieve_command *cmd);


More information about the dovecot-cvs mailing list