more: disable raw mode on error

This commit is contained in:
tpeters
2023-05-24 13:40:14 +02:00
parent 50bff30c67
commit eed916a076
+2 -1
View File
@@ -106,10 +106,11 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
}
let opened_file = match File::open(file) {
Err(why) => {
terminal::disable_raw_mode().unwrap();
return Err(USimpleError::new(
1,
format!("cannot open {}: {}", file.quote(), why.kind()),
))
));
}
Ok(opened_file) => opened_file,
};