summaryrefslogtreecommitdiff
path: root/core/ustring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/ustring.cpp')
-rw-r--r--core/ustring.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 71934b2955..a0d26ea0af 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -3410,8 +3410,17 @@ String String::c_escape() const {
escaped=escaped.replace("\t","\\t");
escaped=escaped.replace("\v","\\v");
escaped=escaped.replace("\'","\\'");
- escaped=escaped.replace("\"","\\\"");
escaped=escaped.replace("\?","\\?");
+ escaped=escaped.replace("\"","\\\"");
+
+ return escaped;
+}
+
+String String::c_escape_multiline() const {
+
+ String escaped=*this;
+ escaped=escaped.replace("\\","\\\\");
+ escaped=escaped.replace("\"","\\\"");
return escaped;
}
@@ -3898,10 +3907,9 @@ String String::get_extension() const {
String String::plus_file(const String& p_file) const {
if (empty())
return p_file;
- if (operator [](length()-1)=='/' || p_file.operator [](0)=='/')
+ if (operator [](length()-1)=='/' || (p_file.size()>0 && p_file.operator [](0)=='/'))
return *this+p_file;
- else
- return *this+"/"+p_file;
+ return *this+"/"+p_file;
}
String String::percent_encode() const {