Skip to content

Commit 708facf

Browse files
krobeluswez
authored andcommitted
Fix crash when terminfo entry is missing description
This fixes a problem with the rio terminal as reported in fish-shell/fish-shell#10359 (comment)
1 parent 870327d commit 708facf

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/database.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ impl Builder {
4949
Ok(Database {
5050
name: self.name.ok_or(())?,
5151
aliases: self.aliases,
52-
description: self.description.ok_or(())?,
52+
description: self.description.unwrap_or_default(),
5353
inner: self.inner,
5454
})
5555
}

src/parser/compiled.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ impl<'a> From<Database<'a>> for crate::Database {
4141

4242
let mut database = crate::Database::new();
4343

44-
database.name(names.remove(0)).description(names.pop().unwrap()).aliases(names);
44+
database.name(names.remove(0));
45+
names.pop().map(|name| database.description(name));
46+
database.aliases(names);
4547

4648
for (index, _) in source.standard.booleans.iter().enumerate().filter(|&(_, &value)| value) {
4749
if let Some(&name) = names::BOOLEAN.get(&(index as u16)) {

0 commit comments

Comments
 (0)