From f9761a89a84fb4aa4502238334c1a40e6d052000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Fri, 22 Nov 2019 10:53:26 +0100 Subject: [PATCH] shared/conf-parser: turn CONFIG_PARSE_REFUSE_BOM flag into a local variable This is an internal implementation detail. --- src/shared/conf-parser.c | 6 +++--- src/shared/conf-parser.h | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 3269d83031..648ac1aa94 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 04c68b18d8..8a6f877bba 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. */