Fix canonicalization adding files with empty name

This commit is contained in:
Leonard Steppy 2025-02-03 13:14:40 +01:00
parent 2eb37aa07a
commit 6d8b16b011

View File

@ -227,6 +227,7 @@ fn main() -> Result<(), String> {
let denoted_files = output let denoted_files = output
.stdout .stdout
.split(|&b| b == b'\n') //split at line breaks .split(|&b| b == b'\n') //split at line breaks
.filter(|bytes| !bytes.is_empty()) //needed since realpath sometimes gives us empty lines
.map(|bytes| PathBuf::from(OsStr::from_bytes(bytes))) .map(|bytes| PathBuf::from(OsStr::from_bytes(bytes)))
.collect::<Vec<_>>(); .collect::<Vec<_>>();
@ -236,6 +237,7 @@ fn main() -> Result<(), String> {
.into_iter() .into_iter()
.flatten() .flatten()
.collect(); .collect();
log!(logger, debug, "canonical files: {files:?}");
} }
ServerAddress::Localhost => files ServerAddress::Localhost => files
.iter() .iter()