String: plus_file(String) no longer adds a root

This commit is contained in:
Ignacio Etcheverry 2017-01-14 17:47:07 +01:00
parent f392b340ff
commit 95396067b7

View file

@ -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;