added BOM detection
authorHeiko Schlittermann (I24) <hs@schlittermann.de>
Sun, 13 Feb 2011 12:12:49 +0100
changeset 2 83c3dcaea98f
parent 1 9f4d070abcf0
child 3 3269aa4bc6c3
added BOM detection
series
src.bail-out-on-BOM
--- a/series	Sat Feb 12 14:45:10 2011 +0100
+++ b/series	Sun Feb 13 12:12:49 2011 +0100
@@ -1,2 +1,3 @@
 doc.maildir_tag
 src.maildir_use_size_file
+src.bail-out-on-BOM
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src.bail-out-on-BOM	Sun Feb 13 12:12:49 2011 +0100
@@ -0,0 +1,17 @@
+# HG changeset patch
+# Parent 2ce70237f5bfb0e5759ea2e0d9ca7e1ecfa73954
+diff -r 2ce70237f5bf -r 5db4d4f2f895 src/readconf.c
+--- a/src/readconf.c	Sun Feb 13 10:31:31 2011 +0100
++++ b/src/readconf.c	Sun Feb 13 12:04:17 2011 +0100
+@@ -2906,6 +2906,11 @@
+ 
+ while ((s = get_config_line()) != NULL)
+   {
++
++  if (config_lineno == 1 && Ustrstr(s, "\xef\xbb\xbf")) 
++    log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, 
++      "Byte Order Mark found (config file should be plain ASCII) <%d>", config_lineno);
++
+   if (isupper(s[0])) read_macro_assignment(s);
+ 
+   else if (Ustrncmp(s, "domainlist", 10) == 0)