Fix: substr("foo",begin:3) now returns "" instead of true

This commit is contained in:
Twan van Laarhoven
2020-04-18 19:34:32 +02:00
parent 3b4f3a948c
commit 9c9eba77a0
+1 -1
View File
@@ -336,7 +336,7 @@ SCRIPT_FUNCTION(substring) {
if (begin < 0) begin = 0;
if (end < 0) end = 0;
if (begin >= end || (size_t)begin >= input.size()) {
SCRIPT_RETURN(wxEmptyString);
SCRIPT_RETURN(String());
} else if ((size_t)end >= input.size()) {
SCRIPT_RETURN(input.substr(begin));
} else {