From: Zbigniew Jędrzejewski-Szmek Date: Fri, 22 Nov 2019 09:53:26 +0000 (+0100) Subject: shared/conf-parser: turn CONFIG_PARSE_REFUSE_BOM flag into a local variable X-Git-Tag: v245-rc1~312^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f9761a89a84fb4aa4502238334c1a40e6d052000;p=thirdparty%2Fsystemd.git shared/conf-parser: turn CONFIG_PARSE_REFUSE_BOM flag into a local variable This is an internal implementation detail. --- diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 3269d830311..648ac1aa948 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -282,7 +282,7 @@ int config_parse(const char *unit, _cleanup_free_ char *section = NULL, *continuation = NULL; _cleanup_fclose_ FILE *ours = NULL; unsigned line = 0, section_line = 0; - bool section_ignored = false; + bool section_ignored = false, bom_seen = false; int r; assert(filename); @@ -328,13 +328,13 @@ int config_parse(const char *unit, continue; l = buf; - if (!(flags & CONFIG_PARSE_REFUSE_BOM)) { + if (!bom_seen) { char *q; q = startswith(buf, UTF8_BYTE_ORDER_MARK); if (q) { l = q; - flags |= CONFIG_PARSE_REFUSE_BOM; + bom_seen = true; } } diff --git a/src/shared/conf-parser.h b/src/shared/conf-parser.h index 04c68b18d8a..8a6f877bba6 100644 --- a/src/shared/conf-parser.h +++ b/src/shared/conf-parser.h @@ -17,7 +17,6 @@ typedef enum ConfigParseFlags { CONFIG_PARSE_RELAXED = 1 << 0, CONFIG_PARSE_ALLOW_INCLUDE = 1 << 1, CONFIG_PARSE_WARN = 1 << 2, - CONFIG_PARSE_REFUSE_BOM = 1 << 3, } ConfigParseFlags; /* Argument list for parsers of specific configuration settings. */