diff options
| author | Julian Hurst <ark@mansus.space> | 2024-10-31 21:26:25 +0100 |
|---|---|---|
| committer | Julian Hurst <ark@mansus.space> | 2024-10-31 21:26:25 +0100 |
| commit | 141645bb9fd2b757e6d6ed4ad78ff14a8b737cc0 (patch) | |
| tree | 2d84a7338ba070fe945409dd5e4a5c3efb543fd4 /config.ha | |
| parent | daf372c98d4a9df43c8270bdf9b414e9820aea90 (diff) | |
| download | distamp-141645bb9fd2b757e6d6ed4ad78ff14a8b737cc0.tar.gz | |
Trim keys and values from the config
Diffstat (limited to 'config.ha')
| -rw-r--r-- | config.ha | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 { |
