]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/conf-parser: turn CONFIG_PARSE_REFUSE_BOM flag into a local variable
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 22 Nov 2019 09:53:26 +0000 (10:53 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 22 Nov 2019 12:11:35 +0000 (13:11 +0100)
This is an internal implementation detail.

src/shared/conf-parser.c
src/shared/conf-parser.h

index 3269d8303117c35de933e374c0f0fac8e2b9b27d..648ac1aa948270322d541c90d3230b0b9780df59 100644 (file)
@@ -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;
                         }
                 }
 
index 04c68b18d8a09ade3ae63b8af55492b851c9edea..8a6f877bba6a246e9273c18b38db2d8b351be2ae 100644 (file)
@@ -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. */