From f4dfa37a23629e011dac74911a87860edf83c63d Mon Sep 17 00:00:00 2001 From: George Marques Date: Fri, 24 Jun 2016 12:39:58 -0300 Subject: [PATCH] Fix bug in String==StrRange comparison It was comparing the StrRange with itself, always return true if both were the same length. Fix #3843 --- core/ustring.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/core/ustring.cpp b/core/ustring.cpp index ea9a9d903e5..4dbe41890d9 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -257,13 +257,10 @@ bool String::operator==(const StrRange &p_range) const { return true; const CharType *c_str=p_range.c_str; - - int l=length(); - - const CharType *dst = p_range.c_str; + const CharType *dst = &operator[](0); /* Compare char by char */ - for (int i=0;i