Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hotfix os independent bytes #163

Merged
merged 2 commits into from
Aug 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::{
env,
fs::{self, File},
io::{BufReader, Read, Write},
os::unix::ffi::OsStrExt as _,
path::{Path, PathBuf},
sync::{
atomic::{AtomicBool, Ordering},
Expand Down Expand Up @@ -212,7 +211,7 @@ pub fn hash_folder(
}
// first hash the filename/dirname to make sure it can't be renamed or removed
let mut hasher = <Sha256 as Digest>::new();
hasher.update(path.as_os_str().as_bytes());
hasher.update(path.to_string_lossy().as_bytes());
// for files, also hash the contents
if let Some(true) = entry.file_type().map(|t| t.is_file()) {
if let Ok(file) = File::open(path) {
Expand Down