1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 03:57:44 +00:00

more: disable raw mode on error

This commit is contained in:
tpeters 2023-05-24 12:30:28 +02:00
parent 50bff30c67
commit eed916a076

View file

@ -106,10 +106,11 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
} }
let opened_file = match File::open(file) { let opened_file = match File::open(file) {
Err(why) => { Err(why) => {
terminal::disable_raw_mode().unwrap();
return Err(USimpleError::new( return Err(USimpleError::new(
1, 1,
format!("cannot open {}: {}", file.quote(), why.kind()), format!("cannot open {}: {}", file.quote(), why.kind()),
)) ));
} }
Ok(opened_file) => opened_file, Ok(opened_file) => opened_file,
}; };