diff options
author | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2017-01-14 17:47:07 +0100 |
---|---|---|
committer | Ignacio Etcheverry <ignalfonsore@gmail.com> | 2017-01-14 18:18:44 +0100 |
commit | 95396067b778c902e2b28efdbe281b4dd4a6effd (patch) | |
tree | de6c07ed45f8f77eac323f240911e9dadb240e4a /core | |
parent | f392b340ffa832f5395e01ff5d96ae553d0983d6 (diff) |
String: plus_file(String) no longer adds a root
Diffstat (limited to 'core')
-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 27bb8eac72..a73a6a3e76 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; |