Merge pull request #7525 from neikeq/pr-plus_file
String: plus_file(String) no longer adds a root
This commit is contained in:
commit
52666b88b3
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue