dovecot-1.2: settings parser: Warn if a line has '#' character n...

dovecot at dovecot.org dovecot at dovecot.org
Tue Oct 20 21:13:05 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/4a6b04c43147
changeset: 9446:4a6b04c43147
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Oct 20 14:12:30 2009 -0400
description:
settings parser: Warn if a line has '#' character not preceded by whitespace.
This should help with people trying to give '#' character in e.g. a
password and wondering why it's not working.

diffstat:

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

diffs (16 lines):

diff -r d7f8dbc38fd7 -r 4a6b04c43147 src/lib-settings/settings.c
--- a/src/lib-settings/settings.c	Tue Oct 20 13:21:13 2009 -0400
+++ b/src/lib-settings/settings.c	Tue Oct 20 14:12:30 2009 -0400
@@ -227,6 +227,12 @@ prevfile:
 				if (*p == '\0')
 					break;
 			} else if (*p == '#') {
+				if (!IS_WHITE(p[-1])) {
+					i_warning("Configuration file %s line %u: "
+						  "Ambiguous '#' character in line, treating it as comment. "
+						  "Add a space before it to remove this warning.",
+						  input->path, input->linenum);
+				}
 				*p = '\0';
 				break;
 			}


More information about the dovecot-cvs mailing list