mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-10-28 20:25:25 +03:00
conf-parser: remove redundant utf8-validity check
This commit is contained in:
parent
97b9c506cf
commit
f106314c89
@ -58,7 +58,6 @@
|
||||
#include "unit-name.h"
|
||||
#include "unit-printf.h"
|
||||
#include "user-util.h"
|
||||
#include "utf8.h"
|
||||
#include "web-util.h"
|
||||
|
||||
static int supported_socket_protocol_from_string(const char *s) {
|
||||
@ -3829,11 +3828,6 @@ int config_parse_namespace_path_strv(
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!utf8_is_valid(word)) {
|
||||
log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, word);
|
||||
continue;
|
||||
}
|
||||
|
||||
w = word;
|
||||
if (startswith(w, "-")) {
|
||||
ignore_enoent = true;
|
||||
|
@ -688,11 +688,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();
|
||||
|
||||
@ -777,12 +772,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();
|
||||
|
@ -171,7 +171,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) {
|
||||
|
Loading…
Reference in New Issue
Block a user