src.bail-out-on-BOM
changeset 3 3269aa4bc6c3
parent 2 83c3dcaea98f
child 18 cacfba0189d0
equal deleted inserted replaced
2:83c3dcaea98f 3:3269aa4bc6c3
     1 # HG changeset patch
     1 # HG changeset patch
     2 # Parent 2ce70237f5bfb0e5759ea2e0d9ca7e1ecfa73954
     2 # Parent fbf873801b0238076818528063f142b791a9b0cb
     3 diff -r 2ce70237f5bf -r 5db4d4f2f895 src/readconf.c
     3 
     4 --- a/src/readconf.c	Sun Feb 13 10:31:31 2011 +0100
     4 diff -r fbf873801b02 src/readconf.c
     5 +++ b/src/readconf.c	Sun Feb 13 12:04:17 2011 +0100
     5 --- a/src/readconf.c	Sun Feb 13 12:15:23 2011 +0100
       
     6 +++ b/src/readconf.c	Sun Feb 13 14:05:44 2011 +0100
     6 @@ -2906,6 +2906,11 @@
     7 @@ -2906,6 +2906,11 @@
     7  
     8  
     8  while ((s = get_config_line()) != NULL)
     9  while ((s = get_config_line()) != NULL)
     9    {
    10    {
    10 +
    11 +
    11 +  if (config_lineno == 1 && Ustrstr(s, "\xef\xbb\xbf")) 
    12 +  if (config_lineno == 1 && Ustrstr(s, "\xef\xbb\xbf") == s) 
    12 +    log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, 
    13 +    log_write(0, LOG_PANIC_DIE|LOG_CONFIG_IN, 
    13 +      "Byte Order Mark found (config file should be plain ASCII) <%d>", config_lineno);
    14 +      "found unexpected BOM (Byte Order Mark)");
    14 +
    15 +
    15    if (isupper(s[0])) read_macro_assignment(s);
    16    if (isupper(s[0])) read_macro_assignment(s);
    16  
    17  
    17    else if (Ustrncmp(s, "domainlist", 10) == 0)
    18    else if (Ustrncmp(s, "domainlist", 10) == 0)