From 141645bb9fd2b757e6d6ed4ad78ff14a8b737cc0 Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Thu, 31 Oct 2024 21:26:25 +0100 Subject: Trim keys and values from the config --- config.ha | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/config.ha b/config.ha index 6a343eb..d3ee234 100644 --- a/config.ha +++ b/config.ha @@ -7,6 +7,7 @@ use io; use fs; use os; use errors; +use strings; type config = struct { tz: chrono::locality, @@ -36,8 +37,10 @@ fn loadconfig() (config | conferror) = { let tz: chrono::locality = chrono::LOCAL; for (const e => ini::next(&sc)!) { - if (e.1 == "tz") { - tz = chrono::tz(e.2)?; + const key = strings::trim(e.1); + const val = strings::trim(e.2); + if (key == "tz") { + tz = chrono::tz(val)?; }; }; return config { -- cgit v1.2.3