Skip to content

Commit f38fc1b

Browse files
committed
mv: fix invalid numbered backup path
1 parent dcb53b6 commit f38fc1b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/uucore/src/lib/features/backup_control.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,8 @@ pub fn get_backup_path(
407407
backup_path: &Path,
408408
suffix: &str,
409409
) -> Option<PathBuf> {
410+
// remove trailing slash
411+
let backup_path = &backup_path.components().collect::<PathBuf>();
410412
match backup_mode {
411413
BackupMode::NoBackup => None,
412414
BackupMode::SimpleBackup => Some(simple_backup_path(backup_path, suffix)),

0 commit comments

Comments
 (0)