aboutsummaryrefslogtreecommitdiff
path: root/core/ustring.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2017-01-14 19:53:35 +0100
committerGitHub2017-01-14 19:53:35 +0100
commit52666b88b39a91655553ba6ab5bbe47c09861e28 (patch)
tree33735f27fc0a1e88bf34d56a6a7d2149000a5754 /core/ustring.cpp
parenta49e75e3741e08cca4c8f6fef41ff8088fe3c057 (diff)
parent95396067b778c902e2b28efdbe281b4dd4a6effd (diff)
downloadgodot-52666b88b39a91655553ba6ab5bbe47c09861e28.tar.gz
godot-52666b88b39a91655553ba6ab5bbe47c09861e28.tar.zst
godot-52666b88b39a91655553ba6ab5bbe47c09861e28.zip
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r--core/ustring.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 9fb8cfc00..66608379b 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -3894,8 +3894,9 @@ String String::get_extension() const {
}
String String::plus_file(const String& p_file) const {
-
- if (length()>0 && operator [](length()-1)=='/')
+ if (empty())
+ return p_file;
+ if (operator [](length()-1)=='/' || p_file.operator [](0)=='/')
return *this+p_file;
else
return *this+"/"+p_file;