diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-12-07 23:12:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-07 23:12:06 +0100 |
commit | fa91944c0652b6584d004a623ff49b4da883b40f (patch) | |
tree | 58d6b099b001ad0fc28dc104a5b0b427b527f75d /core | |
parent | d303a7e6d7f438ea5b27acb39221913aa1a3ffec (diff) | |
parent | f325896c8057c79f1e555a33f97009786ab67b69 (diff) |
Merge pull request #22630 from dualtagh/22478
22478: Can't duplicate folder with another folder inside
Diffstat (limited to 'core')
-rw-r--r-- | core/os/dir_access.cpp | 6 |
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; |