Skip to content
Open
Changes from all commits
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
10 changes: 1 addition & 9 deletions src/uu/install/src/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,17 +577,9 @@ fn is_new_file_path(path: &Path) -> bool {
/// Test if the path is an existing directory or ends with a trailing separator.
///
/// Returns true, if one of the conditions above is met; else false.
///
#[cfg(unix)]
fn is_potential_directory_path(path: &Path) -> bool {
let separator = MAIN_SEPARATOR as u8;
path.as_os_str().as_bytes().last() == Some(&separator) || path.is_dir()
}

#[cfg(not(unix))]
fn is_potential_directory_path(path: &Path) -> bool {
let path_str = path.to_string_lossy();
path_str.ends_with(MAIN_SEPARATOR) || path_str.ends_with('/') || path.is_dir()
path.as_os_str().as_encoded_bytes().last() == Some(&separator) || path.is_dir()
}

/// Perform an install, given a list of paths and behavior.
Expand Down
Loading