From d4887f3ea8959d91b0c669721c42bc98ed8dfe7c Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 26 Feb 2026 15:30:00 +0100 Subject: [PATCH] better symlink handling --- src/main.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 05eebff..4bd9aea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,7 @@ use osc94::Progress; use rayon::prelude::*; use std::borrow::Cow; use std::collections::HashMap; -use std::fs::File; +use std::fs::{canonicalize, File}; use std::io::{read_to_string, stdin, BufReader, Stderr, Write}; use std::iter::once; use std::sync::atomic::{AtomicUsize, Ordering}; @@ -90,6 +90,11 @@ fn main() -> MainResult { })?; LogFile::from_string(content) } else { + let path = canonicalize(path)?; + let path = path + .into_os_string() + .into_string() + .map_err(|_| "non utf8 path")?; let file = File::open(&path)?; let file = BufReader::new(file); LogFile::open(&path, file).map_err(|err| LogError::Read { err, path })?