1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +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) {
Err(why) => {
terminal::disable_raw_mode().unwrap();
return Err(USimpleError::new(
1,
format!("cannot open {}: {}", file.quote(), why.kind()),
))
));
}
Ok(opened_file) => opened_file,
};