[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:27:28 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 4dadc8fac54bbcd2f3767d961f16d498ade28ab7
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Feb 24 19:36:39 2004 +0000
Tests:
Reviewed by Ken.
* qt/qstring-test.cpp: (main): Added an endsWith test.
* qt/qstring-test.chk: Added the expected result.
WebCore:
Reviewed by Ken.
* kwq/KWQString.mm: (QString::endsWith): Fixed broken end of string test, to get rid
of false positives.
* WebCore-tests.exp: Added endsWith so it can be tested.
* WebCore-combined.exp: Regenerated.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6111 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 3265fce..c523bf1 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,13 @@
+2004-02-24 Darin Adler <darin at apple.com>
+
+ Reviewed by Ken.
+
+ * kwq/KWQString.mm: (QString::endsWith): Fixed broken end of string test, to get rid
+ of false positives.
+
+ * WebCore-tests.exp: Added endsWith so it can be tested.
+ * WebCore-combined.exp: Regenerated.
+
2004-02-23 David Hyatt <hyatt at apple.com>
Fix for 3549772, hangs on border collapsing.
diff --git a/WebCore/WebCore-combined.exp b/WebCore/WebCore-combined.exp
index 940439d..1e1dbb9 100644
--- a/WebCore/WebCore-combined.exp
+++ b/WebCore/WebCore-combined.exp
@@ -302,6 +302,7 @@ __ZNK7QString7findRevEPKci
__ZNK7QString7findRevEci
__ZNK7QString8containsEPKcb
__ZNK7QString8containsEc
+__ZNK7QString8endsWithERKS_
__ZNK7QString8toDoubleEPb
__ZNK7QString8toUShortEPbi
__ZNK8QCString3midEjj
diff --git a/WebCore/WebCore-tests.exp b/WebCore/WebCore-tests.exp
index 92b3b2f..ed35454 100644
--- a/WebCore/WebCore-tests.exp
+++ b/WebCore/WebCore-tests.exp
@@ -268,6 +268,7 @@ __ZNK7QString7findRevEPKci
__ZNK7QString7findRevEci
__ZNK7QString8containsEPKcb
__ZNK7QString8containsEc
+__ZNK7QString8endsWithERKS_
__ZNK7QString8toDoubleEPb
__ZNK7QString8toUShortEPbi
__ZNK8QCString3midEjj
diff --git a/WebCore/kwq/KWQString.mm b/WebCore/kwq/KWQString.mm
index e4bce36..36eec39 100644
--- a/WebCore/kwq/KWQString.mm
+++ b/WebCore/kwq/KWQString.mm
@@ -1063,18 +1063,21 @@ bool QString::startsWith(const char *prefix, bool caseSensitive) const
}
}
-bool QString::endsWith( const QString& s ) const
+bool QString::endsWith(const QString& s) const
{
const QChar *uni = unicode();
- if (dataHandle[0]->_length < s.dataHandle[0]->_length)
- return FALSE;
-
- for ( int i = dataHandle[0]->_length - s.dataHandle[0]->_length, j = 0; i < (int) s.dataHandle[0]->_length; i++, j++ ) {
- if ( uni[i] != s[j] )
- return FALSE;
+ int length = dataHandle[0]->_length;
+ int slength = s.dataHandle[0]->_length;
+ if (length < slength)
+ return false;
+
+ for (int i = length - slength, j = 0; i < length; i++, j++) {
+ if (uni[i] != s[j])
+ return false;
}
- return TRUE;
+
+ return true;
}
QCString QString::utf8(int &length) const
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list