mirror of
https://github.com/eycorsican/leaf.git
synced 2026-12-05 16:02:32 +00:00
conf: fix std::env::set_var with NUL byte
This commit is contained in:
1 parent
e8a7eb9a3f
commit
b9fa3ddd00
1 file changed
+1
-1
@@ -257,7 +257,7 @@ where
|
||||
pub fn from_lines(lines: Vec<io::Result<String>>) -> Result<Config> {
|
||||
let env_lines = get_lines_by_section("Env", lines.iter());
|
||||
for line in env_lines {
|
||||
let parts: Vec<&str> = line.split('=').map(str::trim).collect();
|
||||
let parts: Vec<&str> = line.split('=').map(|s| s.trim_matches('\u{0}')).map(str::trim).collect();
|
||||
if parts.len() != 2 {
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user