From ad84851f3047a67cddb78903a5053d8731998330 Mon Sep 17 00:00:00 2001 From: Shell Chen Date: Tue, 9 Jan 2024 17:52:09 +0800 Subject: [PATCH] Fix ini parsing error after dependency update See zonyitoo/rust-ini#119 --- src/server.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/server.rs b/src/server.rs index 5aa733d..126fe58 100644 --- a/src/server.rs +++ b/src/server.rs @@ -285,6 +285,10 @@ impl ServerListConfig { if let Some(path) = &self.path { let ini = Ini::load_from_file(path).context("cannot read server list file")?; for (section, props) in ini.iter() { + if section.is_none() && props.is_empty() { + // `rust-ini` always return empty general section on 0.19 & 0.20 + continue; + } let server = self .load_proxy_from_ini_section(section, props) .with_context(|| {