From 95396067b778c902e2b28efdbe281b4dd4a6effd Mon Sep 17 00:00:00 2001 From: Ignacio Etcheverry Date: Sat, 14 Jan 2017 17:47:07 +0100 Subject: [PATCH] String: plus_file(String) no longer adds a root --- core/ustring.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/ustring.cpp b/core/ustring.cpp index 27bb8eac725..a73a6a3e76e 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;