Merge pull request #7525 from neikeq/pr-plus_file

String: plus_file(String) no longer adds a root
This commit is contained in:
Rémi Verschelde 2017-01-14 19:53:35 +01:00 committed by GitHub
commit 52666b88b3

View file

@ -3894,8 +3894,9 @@ String String::get_extension() const {
} }
String String::plus_file(const String& p_file) const { String String::plus_file(const String& p_file) const {
if (empty())
if (length()>0 && operator [](length()-1)=='/') return p_file;
if (operator [](length()-1)=='/' || p_file.operator [](0)=='/')
return *this+p_file; return *this+p_file;
else else
return *this+"/"+p_file; return *this+"/"+p_file;