summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qbytearraymatcher.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qbytearraymatcher.h')
-rw-r--r--src/corelib/tools/qbytearraymatcher.h7
1 files changed, 6 insertions, 1 deletions
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;