Skip to content

Commit

Permalink
fix: detection of hex prefixed terminfo paths
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalkuthe committed Oct 21, 2022
1 parent d6960a3 commit ed5637f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "termini"
version = "0.1.2"
version = "0.1.3"
edition = "2021"
exclude = ["fuzz", "tests"]

Expand Down
13 changes: 8 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit ed5637f

Please sign in to comment.