From ea3460b32688df8e383c830f2021eba390a72a4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bence=20T=C3=B3th?= Date: Fri, 10 Jan 2025 15:32:22 +0100 Subject: [PATCH] Fix bug for order dependent exit code. The following execution would log an error but return 0: `tex-fmt --check unformatted.tex formatted.tex` because the 0 overwrote the previously set exit code --- src/format.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/format.rs b/src/format.rs index 979ed08..a196a83 100644 --- a/src/format.rs +++ b/src/format.rs @@ -267,7 +267,7 @@ pub fn run(args: &Args, logs: &mut Vec) -> u8 { for file in &args.files { if let Some((file, text)) = read(file, logs) { let new_text = format_file(&text, &file, args, logs); - exit_code = process_output(args, &file, &text, &new_text, logs); + exit_code |= process_output(args, &file, &text, &new_text, logs); } else { exit_code = 1; }