diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-04-23 13:47:30 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-04-23 13:47:30 (GMT) |
commit | ff4864e079accef109a8a45e9754f7ac34718ec5 (patch) | |
tree | 004c0e6dc99187fa6e2dd35b898c4b41ce30d06e /src/corelib | |
parent | 63414acd04910b6b016786f1c340440562eebca1 (diff) | |
parent | 2e8ece735d6a31f4657192e77b9dc53fb2a03e9c (diff) | |
download | Qt-ff4864e079accef109a8a45e9754f7ac34718ec5.zip Qt-ff4864e079accef109a8a45e9754f7ac34718ec5.tar.gz Qt-ff4864e079accef109a8a45e9754f7ac34718ec5.tar.bz2 |
Merge branch '4.5'
Conflicts:
tests/auto/qaction/tst_qaction.cpp
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qbytearraymatcher.cpp | 3 | ||||
-rw-r--r-- | src/corelib/tools/qbytearraymatcher.h | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/corelib/tools/qbytearraymatcher.cpp b/src/corelib/tools/qbytearraymatcher.cpp index cd4cf90..211d190 100644 --- a/src/corelib/tools/qbytearraymatcher.cpp +++ b/src/corelib/tools/qbytearraymatcher.cpp @@ -120,6 +120,7 @@ QByteArrayMatcher::QByteArrayMatcher() : d(0) { p.p = 0; + p.l = 0; qMemSet(p.q_skiptable, 0, sizeof(p.q_skiptable)); } @@ -170,7 +171,7 @@ QByteArrayMatcher::~QByteArrayMatcher() QByteArrayMatcher &QByteArrayMatcher::operator=(const QByteArrayMatcher &other) { q_pattern = other.q_pattern; - qMemCopy(p.q_skiptable, other.p.q_skiptable, sizeof(p.q_skiptable)); + qMemCopy(&p, &other.p, sizeof(p)); return *this; } diff --git a/src/corelib/tools/qbytearraymatcher.h b/src/corelib/tools/qbytearraymatcher.h index d7f2366..633e92c 100644 --- a/src/corelib/tools/qbytearraymatcher.h +++ b/src/corelib/tools/qbytearraymatcher.h @@ -67,7 +67,12 @@ public: int indexIn(const QByteArray &ba, int from = 0) const; int indexIn(const char *str, int len, int from = 0) const; - inline QByteArray pattern() const { return q_pattern; } + inline QByteArray pattern() const + { + if (q_pattern.isNull()) + return QByteArray((const char*)p.p, p.l); + return q_pattern; + } private: QByteArrayMatcherPrivate *d; |