summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDualtagh Murray <dualtagh.murray@gonitro.com>2018-10-02 16:19:11 +0100
committerDualtagh Murray <dualtagh.murray@gonitro.com>2018-10-02 16:21:35 +0100
commitf325896c8057c79f1e555a33f97009786ab67b69 (patch)
tree6e205f24c2315a406a382e6d9f6742c539bf6919
parentb05efd98ffe3036b05e501b26ed2ee811161ee11 (diff)
22478: Can't duplicate folder with another folder inside
-rw-r--r--core/os/dir_access.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/os/dir_access.cpp b/core/os/dir_access.cpp
index daa3eacd5f..ce70b859eb 100644
--- a/core/os/dir_access.cpp
+++ b/core/os/dir_access.cpp
@@ -431,8 +431,12 @@ Error DirAccess::copy_dir(String p_from, String p_to, int p_chmod_flags) {
ERR_FAIL_COND_V(err, err);
}
+ if (!p_to.ends_with("/")) {
+ p_to = p_to + "/";
+ }
+
DirChanger dir_changer(this, p_from);
- Error err = _copy_dir(target_da, p_to + "/", p_chmod_flags);
+ Error err = _copy_dir(target_da, p_to, p_chmod_flags);
memdelete(target_da);
return err;