changeset 9446:4a6b04c43147 HEAD

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.
author Timo Sirainen <tss@iki.fi>
date Tue, 20 Oct 2009 14:12:30 -0400
parents d7f8dbc38fd7
children 36b8d97d0f58
files src/lib-settings/settings.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 				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;
 			}