mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-18 06:03:42 +03:00
shared/conf-parser: remove unnecessary whitespace skipping
The conf-parser machinery already removed whitespace before and after "=", no need to repeat this step. The test is adjusted to pass. It was testing an code path that doesn't happen normally, no point in doing that.
This commit is contained in:
parent
c57d2a76c5
commit
b9d9fbe411
@ -614,7 +614,6 @@ int config_parse_exec(
|
||||
assert(e);
|
||||
|
||||
e += ltype;
|
||||
rvalue += strspn(rvalue, WHITESPACE);
|
||||
|
||||
if (isempty(rvalue)) {
|
||||
/* An empty assignment resets the list */
|
||||
@ -1951,7 +1950,6 @@ int config_parse_service_timeout_abort(
|
||||
assert(rvalue);
|
||||
assert(s);
|
||||
|
||||
rvalue += strspn(rvalue, WHITESPACE);
|
||||
if (isempty(rvalue)) {
|
||||
s->timeout_abort_set = false;
|
||||
return 0;
|
||||
@ -5002,7 +5000,6 @@ int config_parse_timeout_abort(
|
||||
assert(rvalue);
|
||||
assert(timeout_usec);
|
||||
|
||||
rvalue += strspn(rvalue, WHITESPACE);
|
||||
if (isempty(rvalue)) {
|
||||
*timeout_usec = false;
|
||||
return 0;
|
||||
|
@ -227,8 +227,8 @@ static const char* const config_file[] = {
|
||||
"[Section]\n"
|
||||
"[Section]\n"
|
||||
"setting1=1\n"
|
||||
"setting1=2\n"
|
||||
"setting1=1\n", /* repeated settings */
|
||||
"setting1= 2 \t\n"
|
||||
"setting1= 1\n", /* repeated settings */
|
||||
|
||||
"[Section]\n"
|
||||
"[Section]\n"
|
||||
|
@ -146,7 +146,7 @@ static void test_config_parse_exec(void) {
|
||||
|
||||
log_info("/* no command, whitespace only, reset */");
|
||||
r = config_parse_exec(NULL, "fake", 3, "section", 1,
|
||||
"LValue", 0, " ",
|
||||
"LValue", 0, "",
|
||||
&c, u);
|
||||
assert_se(r == 0);
|
||||
assert_se(c == NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user