mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
..
This commit is contained in:
parent
c362137361
commit
723bb1e170
1 changed files with 2 additions and 2 deletions
|
|
@ -72,7 +72,7 @@ impl Scheduler {
|
||||||
let mut ongoing = self.ongoing.lock();
|
let mut ongoing = self.ongoing.lock();
|
||||||
let id = ongoing.add(TaskKind::User, format!("Cut {:?} to {:?}", from, to));
|
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();
|
self.new_and_fail(id, "Cannot cut directory into itself").ok();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +110,7 @@ impl Scheduler {
|
||||||
let name = format!("Copy {:?} to {:?}", from, to);
|
let name = format!("Copy {:?} to {:?}", from, to);
|
||||||
let id = self.ongoing.lock().add(TaskKind::User, name);
|
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();
|
self.new_and_fail(id, "Cannot copy directory into itself").ok();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue