chiark / gitweb /
conf-parser: remove redundant utf8-validity check
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 3 Jun 2018 15:36:46 +0000 (00:36 +0900)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
src/shared/conf-parser.c
src/test/test-conf-parser.c

index 96bcddb4fcf85ffcefac3024be4b4ee0d3c70bfe..a43e595cc190a8f796a38939ce20e6257fd7a620 100644 (file)
@@ -45,6 +45,7 @@
 //#include "rlimit-util.h"
 //#include "rlimit-util.h"
 //#include "rlimit-util.h"
+//#include "rlimit-util.h"
 
 int config_item_table_lookup(
                 const void *table,
@@ -709,11 +710,6 @@ int config_parse_string(
         assert(rvalue);
         assert(data);
 
-        if (!utf8_is_valid(rvalue)) {
-                log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, rvalue);
-                return 0;
-        }
-
         if (free_and_strdup(s, empty_to_null(rvalue)) < 0)
                 return log_oom();
 
@@ -798,12 +794,6 @@ int config_parse_strv(
                         break;
                 }
 
-                if (!utf8_is_valid(word)) {
-                        log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, word);
-                        free(word);
-                        continue;
-                }
-
                 r = strv_consume(sv, word);
                 if (r < 0)
                         return log_oom();
index b95aa7a22c43f86a458eb7abcaa95f7b2e8f0d1f..0e531bb217d8b2add78811fb92a49525fdc66693 100644 (file)
@@ -185,7 +185,7 @@ static void test_config_parse_strv(void) {
         test_config_parse_strv_one("foo bar foo", STRV_MAKE("foo", "bar", "foo"));
         test_config_parse_strv_one("\"foo bar\" foo", STRV_MAKE("foo bar", "foo"));
         test_config_parse_strv_one("\xc3\x80", STRV_MAKE("\xc3\x80"));
-        test_config_parse_strv_one("\xc3\x7f", STRV_MAKE_EMPTY);
+        test_config_parse_strv_one("\xc3\x7f", STRV_MAKE("\xc3\x7f"));
 }
 
 static void test_config_parse_mode(void) {