mirror of
https://github.com/minetest/minetest.git
synced 2024-11-04 23:03:46 +01:00
Main Menu: Allow copying directories from non-Minetest locations (#6095)
Allow `core.copy_dir` (main menu API) to copy directories from a non-Minetest location. The check to disallow copying to non-Minetest locations is retained.
This commit is contained in:
parent
7c24889773
commit
66c4108581
@ -813,8 +813,7 @@ int ModApiMainMenu::l_copy_dir(lua_State *L)
|
|||||||
std::string absolute_destination = fs::RemoveRelativePathComponents(destination);
|
std::string absolute_destination = fs::RemoveRelativePathComponents(destination);
|
||||||
std::string absolute_source = fs::RemoveRelativePathComponents(source);
|
std::string absolute_source = fs::RemoveRelativePathComponents(source);
|
||||||
|
|
||||||
if ((ModApiMainMenu::isMinetestPath(absolute_source)) &&
|
if ((ModApiMainMenu::isMinetestPath(absolute_destination))) {
|
||||||
(ModApiMainMenu::isMinetestPath(absolute_destination))) {
|
|
||||||
bool retval = fs::CopyDir(absolute_source,absolute_destination);
|
bool retval = fs::CopyDir(absolute_source,absolute_destination);
|
||||||
|
|
||||||
if (retval && (!keep_source)) {
|
if (retval && (!keep_source)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user