From a6b97b648a4c42b4bb5b75dcc6edceefa68bc347 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 24 Jun 2009 13:17:03 +0200 Subject: Fix comparison of different-sized QStringRefs. Two strings are only equal if they have the same size. Task-number: 256763 Reviewed-by: TrustMe --- src/corelib/tools/qstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 7e1f6c7..9427ca3 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -169,7 +169,7 @@ static int ucstricmp(const ushort *a, const ushort *ae, const uchar *b) // Unicode case-insensitive comparison static int ucstrcmp(const QChar *a, int alen, const QChar *b, int blen) { - if (a == b) + if (a == b && alen == blen) return 0; int l = qMin(alen, blen); while (l-- && *a == *b) -- cgit v0.12