dovecot-2.0: settings parser: If first line begins with "ERROR "...

dovecot at dovecot.org dovecot at dovecot.org
Sat Aug 15 01:14:58 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/4011a41cf404
changeset: 9795:4011a41cf404
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Aug 14 18:14:50 2009 -0400
description:
settings parser: If first line begins with "ERROR ", return it as the error message.

diffstat:

1 file changed, 4 insertions(+)
src/lib-settings/settings-parser.c |    4 ++++

diffs (14 lines):

diff -r da330a07e45c -r 4011a41cf404 src/lib-settings/settings-parser.c
--- a/src/lib-settings/settings-parser.c	Fri Aug 14 18:14:21 2009 -0400
+++ b/src/lib-settings/settings-parser.c	Fri Aug 14 18:14:50 2009 -0400
@@ -477,6 +477,10 @@ int settings_parse_stream(struct setting
 			return 0;
 		}
 		ctx->linenum++;
+		if (ctx->linenum == 1 && strncmp(line, "ERROR ", 6) == 0) {
+			ctx->error = p_strdup(ctx->parser_pool, line + 6);
+			return -1;
+		}
 
 		T_BEGIN {
 			line = settings_translate_lf(line);


More information about the dovecot-cvs mailing list