You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Merge pull request #51429 from omar-polo/fix-basename
This commit is contained in:
@@ -463,7 +463,10 @@ Error OS_LinuxBSD::move_to_trash(const String &p_path) {
|
|||||||
// The trash can is successfully created, now we check that we don't exceed our file name length limit.
|
// The trash can is successfully created, now we check that we don't exceed our file name length limit.
|
||||||
// If the file name is too long trim it so we can add the identifying number and ".trashinfo".
|
// If the file name is too long trim it so we can add the identifying number and ".trashinfo".
|
||||||
// Assumes that the file name length limit is 255 characters.
|
// Assumes that the file name length limit is 255 characters.
|
||||||
String file_name = basename(p_path.utf8().get_data());
|
String file_name = p_path.get_file();
|
||||||
|
if (file_name.length() == 0) {
|
||||||
|
file_name = p_path.get_base_dir().get_file();
|
||||||
|
}
|
||||||
if (file_name.length() > 240) {
|
if (file_name.length() > 240) {
|
||||||
file_name = file_name.substr(0, file_name.length() - 15);
|
file_name = file_name.substr(0, file_name.length() - 15);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user