From ed5637ff5f51236f03c5ed7e92122679d0d6b12b Mon Sep 17 00:00:00 2001 From: Pascal Kuthe Date: Fri, 21 Oct 2022 14:56:59 +0200 Subject: [PATCH] fix: detection of hex prefixed terminfo paths --- Cargo.toml | 2 +- src/lib.rs | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 98fa74e..04ca61d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "termini" -version = "0.1.2" +version = "0.1.3" edition = "2021" exclude = ["fuzz", "tests"] diff --git a/src/lib.rs b/src/lib.rs index 035b8d2..0aabefc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -281,17 +281,20 @@ impl TermInfo { } // Check standard location. - let mut path = path.clone(); - path.push(first.to_string()); - path.push(name); + { + let mut path = path.clone(); + path.push(first.to_string()); + path.push(name); - if fs::metadata(&path).is_ok() { - return Self::from_path(&path); + if fs::metadata(&path).is_ok() { + return Self::from_path(&path); + } } // Check non-standard location. let mut path = path.clone(); path.push(format!("{:x}", first as usize)); + println!("{}", path.display()); path.push(name); if fs::metadata(&path).is_ok() {