diff options
| author | Ignacio Etcheverry | 2017-01-14 17:47:07 +0100 |
|---|---|---|
| committer | Ignacio Etcheverry | 2017-01-14 18:18:44 +0100 |
| commit | 95396067b778c902e2b28efdbe281b4dd4a6effd (patch) | |
| tree | de6c07ed45f8f77eac323f240911e9dadb240e4a /core/ustring.cpp | |
| parent | f392b340ffa832f5395e01ff5d96ae553d0983d6 (diff) | |
| download | godot-95396067b778c902e2b28efdbe281b4dd4a6effd.tar.gz godot-95396067b778c902e2b28efdbe281b4dd4a6effd.tar.zst godot-95396067b778c902e2b28efdbe281b4dd4a6effd.zip | |
String: plus_file(String) no longer adds a root
Diffstat (limited to 'core/ustring.cpp')
| -rw-r--r-- | core/ustring.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp index 27bb8eac7..a73a6a3e7 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3822,8 +3822,9 @@ String String::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; |
