From f0baf8f2f3778d21692d377d32bd4e372cef2aae Mon Sep 17 00:00:00 2001 From: auric Date: Sun, 22 Feb 2026 19:00:47 -0600 Subject: Fix YAML parser not reading log paths from sequence Sequence items arrive as SCALAR events with in_value==0 (no preceding key), so they were being treated as keys and silently discarded. Handle SECTION_LOGS scalars directly as list items when in_value is unset, leaving the normal key/value path for all other sections. Co-Authored-By: Claude Sonnet 4.6 --- src/unit.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/unit.c') diff --git a/src/unit.c b/src/unit.c index 5baea20..429c2ce 100644 --- a/src/unit.c +++ b/src/unit.c @@ -135,6 +135,13 @@ int unit_load_file(const char *path, Unit *out) { const char *val = (const char *)event.data.scalar.value; if (!in_value) { + /* Sequence items (logs list) arrive as scalars without a + * preceding key — handle them directly as values */ + if (section == SECTION_LOGS) { + if (out->log_count < 4) + strncpy(out->log_paths[out->log_count++], val, + MAX_PATH - 1); + } else { /* This is a key */ strncpy(last_key, val, sizeof(last_key) - 1); @@ -149,6 +156,7 @@ int unit_load_file(const char *path, Unit *out) { section = SECTION_ACTIONS; else in_value = 1; + } } else { /* This is a value */ in_value = 0; -- cgit v1.2.3