mirror of
https://codeberg.org/icewind/logsmash.git
synced 2026-06-03 10:04:12 +02:00
better symlink handling
This commit is contained in:
parent
8a6f31d124
commit
d4887f3ea8
1 changed files with 6 additions and 1 deletions
|
|
@ -17,7 +17,7 @@ use osc94::Progress;
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::collections::HashMap;
|
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::io::{read_to_string, stdin, BufReader, Stderr, Write};
|
||||||
use std::iter::once;
|
use std::iter::once;
|
||||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||||
|
|
@ -90,6 +90,11 @@ fn main() -> MainResult {
|
||||||
})?;
|
})?;
|
||||||
LogFile::from_string(content)
|
LogFile::from_string(content)
|
||||||
} else {
|
} 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 = File::open(&path)?;
|
||||||
let file = BufReader::new(file);
|
let file = BufReader::new(file);
|
||||||
LogFile::open(&path, file).map_err(|err| LogError::Read { err, path })?
|
LogFile::open(&path, file).map_err(|err| LogError::Read { err, path })?
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue