Skip to content

Commit d6960a3

Browse files
committed
fix: incorrect terminfo search path
1 parent 1f5a8f3 commit d6960a3

File tree

4 files changed

+13
-16
lines changed

4 files changed

+13
-16
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "termini"
3-
version = "0.1.1"
3+
version = "0.1.2"
44
edition = "2021"
55
exclude = ["fuzz", "tests"]
66

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# termini - minimal terminfo
2-
![crates.io](https://img.shields.io/crates/v/termini?style=flat-square)
2+
[![crates.io](https://img.shields.io/crates/v/termini?style=flat-square)](https://crates.io/crates/termini)
33
![crates.io](https://img.shields.io/crates/l/termini?style=flat-square)
44

55
`termini` is a Rust library that provides access to the `terminfo` database.

src/lib.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -249,14 +249,14 @@ impl TermInfo {
249249
// See https://manpages.debian.org/buster/ncurses-bin/TermInfo.5.en.html#Fetching_Compiled_Descriptions
250250
let mut search = Vec::<PathBuf>::new();
251251

252-
if let Some(dir) = env::var_os("TermInfo") {
252+
if let Some(dir) = env::var_os("TERMINFO") {
253253
search.push(dir.into());
254254
} else if let Some(mut home) = home_dir() {
255-
home.push(".TermInfo");
255+
home.push(".terminfo");
256256
search.push(home);
257257
}
258258

259-
if let Ok(dirs) = env::var("TermInfo_DIRS") {
259+
if let Ok(dirs) = env::var("TERMINFO_DIRS") {
260260
for dir in dirs.split(':') {
261261
search.push(dir.into());
262262
}
@@ -265,15 +265,15 @@ impl TermInfo {
265265
// handle non-FHS systems like Termux
266266
if let Ok(prefix) = env::var("PREFIX") {
267267
let path = Path::new(&prefix);
268-
search.push(path.join("etc/TermInfo"));
269-
search.push(path.join("lib/TermInfo"));
270-
search.push(path.join("share/TermInfo"));
268+
search.push(path.join("etc/terminfo"));
269+
search.push(path.join("lib/terminfo"));
270+
search.push(path.join("share/terminfo"));
271271
}
272272

273-
search.push("/etc/TermInfo".into());
274-
search.push("/lib/TermInfo".into());
275-
search.push("/usr/share/TermInfo".into());
276-
search.push("/boot/system/data/TermInfo".into());
273+
search.push("/etc/terminfo".into());
274+
search.push("/lib/terminfo".into());
275+
search.push("/usr/share/terminfo".into());
276+
search.push("/boot/system/data/terminfo".into());
277277

278278
for path in search {
279279
if fs::metadata(&path).is_err() {

src/parsing.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,7 @@ fn try_parse_ext_capabilities(
180180
}
181181
let res = get_str_with_offset(&*data.str_table, off, names_off)?.to_owned();
182182
match String::from_utf8(res) {
183-
Ok(res) => {
184-
println!("{res}");
185-
Some(Ok(res))
186-
}
183+
Ok(res) => Some(Ok(res)),
187184
Err(err) => Some(Err(err.into())),
188185
}
189186
});

0 commit comments

Comments
 (0)