summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslcertificate.cpp
diff options
context:
space:
mode:
authorZeno Albisser <zeno.albisser@nokia.com>2010-06-15 11:39:25 (GMT)
committerZeno Albisser <zeno.albisser@nokia.com>2010-06-15 13:05:21 (GMT)
commit20a39c16f236f999cd1694cdc47a3739efcbbfe4 (patch)
tree2a12f3ecd842165fb0e9e2380f892fe1fa391b57 /src/network/ssl/qsslcertificate.cpp
parent2cb5d8f7425bce83b5e95925e15d7920be3d2e8d (diff)
downloadQt-20a39c16f236f999cd1694cdc47a3739efcbbfe4.zip
Qt-20a39c16f236f999cd1694cdc47a3739efcbbfe4.tar.gz
Qt-20a39c16f236f999cd1694cdc47a3739efcbbfe4.tar.bz2
Temporary fix for regression in QSslCertificate::fromPath()
The regression was introduced with 164f347aba7287407615223dc2219a016ebc8248. As soon as possible we should probably rewrite the fromPath() function, to have a proper solution. Nevertheless this might be a bigger change and should not be done so late in release cycle. Reviewed-by: TrustMe
Diffstat (limited to 'src/network/ssl/qsslcertificate.cpp')
-rw-r--r--src/network/ssl/qsslcertificate.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/network/ssl/qsslcertificate.cpp b/src/network/ssl/qsslcertificate.cpp
index ed12e00..a3ea555 100644
--- a/src/network/ssl/qsslcertificate.cpp
+++ b/src/network/ssl/qsslcertificate.cpp
@@ -537,7 +537,7 @@ QList<QSslCertificate> QSslCertificate::fromPath(const QString &path,
// $, (,), *, +, ., ?, [, ,], ^, {, | and }.
int pos = -1;
if (syntax == QRegExp::Wildcard)
- pos = path.indexOf(QRegExp(QLatin1String("[\\*\\?\\[]")));
+ pos = path.indexOf(QRegExp(QLatin1String("[^\\][\\*\\?\\[\\]]")));
else if (syntax != QRegExp::FixedString)
pos = path.indexOf(QRegExp(QLatin1String("[^\\][\\$\\(\\)\\*\\+\\.\\?\\[\\]\\^\\{\\}\\|]")));
QString pathPrefix = path.left(pos); // == path if pos < 0
@@ -548,8 +548,13 @@ QList<QSslCertificate> QSslCertificate::fromPath(const QString &path,
// chop off the first two characters from the glob'ed paths.
int startIndex = 0;
if (pathPrefix.trimmed().isEmpty()) {
- startIndex = 2;
- pathPrefix = QLatin1String(".");
+ if(path.startsWith(QLatin1Char('/'))) {
+ pathPrefix = path.left(path.indexOf(QRegExp(QLatin1String("[\\*\\?\\[]"))));
+ pathPrefix = path.left(path.lastIndexOf(QLatin1Char('/')));
+ } else {
+ startIndex = 2;
+ pathPrefix = QLatin1String(".");
+ }
}
// The path is a file.