From 723bb1e1703f65f92d0720d10f9351495642484a Mon Sep 17 00:00:00 2001 From: sxyazi Date: Sat, 20 Apr 2024 11:14:45 +0800 Subject: [PATCH] .. --- yazi-scheduler/src/scheduler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/yazi-scheduler/src/scheduler.rs b/yazi-scheduler/src/scheduler.rs index f8c9bec4..33eb2391 100644 --- a/yazi-scheduler/src/scheduler.rs +++ b/yazi-scheduler/src/scheduler.rs @@ -72,7 +72,7 @@ impl Scheduler { let mut ongoing = self.ongoing.lock(); let id = ongoing.add(TaskKind::User, format!("Cut {:?} to {:?}", from, to)); - if to.starts_with(&from) { + if to.starts_with(&from) && to != from { self.new_and_fail(id, "Cannot cut directory into itself").ok(); return; } @@ -110,7 +110,7 @@ impl Scheduler { let name = format!("Copy {:?} to {:?}", from, to); let id = self.ongoing.lock().add(TaskKind::User, name); - if to.starts_with(&from) { + if to.starts_with(&from) && to != from { self.new_and_fail(id, "Cannot copy directory into itself").ok(); return; }