1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-30 14:55:37 +03:00

bootspec: let's actually use the result of strstrip() for further parsing

Also, given we are looking for whitespace as separators, just pass NULL
as separators, extract_first_word() defaults to whitespace after all.
This commit is contained in:
Lennart Poettering 2022-09-02 11:07:22 +02:00
parent bb9133bb46
commit da8f277c09

View File

@ -205,11 +205,11 @@ static int boot_entry_load_type1(
line++; line++;
if (IN_SET(*strstrip(buf), '#', '\0')) p = strstrip(buf);
if (IN_SET(p[0], '#', '\0'))
continue; continue;
p = buf; r = extract_first_word(&p, &field, NULL, 0);
r = extract_first_word(&p, &field, " \t", 0);
if (r < 0) { if (r < 0) {
log_error_errno(r, "Failed to parse config file %s line %u: %m", tmp.path, line); log_error_errno(r, "Failed to parse config file %s line %u: %m", tmp.path, line);
continue; continue;
@ -331,11 +331,11 @@ int boot_loader_read_conf(BootConfig *config, FILE *file, const char *path) {
line++; line++;
if (IN_SET(*strstrip(buf), '#', '\0')) p = strstrip(buf);
if (IN_SET(p[0], '#', '\0'))
continue; continue;
p = buf; r = extract_first_word(&p, &field, NULL, 0);
r = extract_first_word(&p, &field, " \t", 0);
if (r < 0) { if (r < 0) {
log_error_errno(r, "Failed to parse config file %s line %u: %m", path, line); log_error_errno(r, "Failed to parse config file %s line %u: %m", path, line);
continue; continue;