summaryrefslogtreecommitdiffstats
path: root/src/network/ssl/qsslcertificate.cpp
diff options
context:
space:
mode:
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.