diff options
author | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-05-11 22:05:09 +0200 |
---|---|---|
committer | Dominik Riebeling <Dominik.Riebeling@gmail.com> | 2012-05-11 22:07:34 +0200 |
commit | 4b5348ba04a62335757d439aa1acb8a3579c267d (patch) | |
tree | 17a7dcf303d299f88417c5f0c90fec84df6e5d78 | |
parent | fbe9ccc85cbbd4355415694990fe58003c5c2beb (diff) |
Don't try to resolve an empty path.
An empty path is not resolvable, so immediately return an empty result. Fixes
an empty path resolve to "/" on Linux / OS X.
Change-Id: I22c26a7716becbf46850a04e18ee581084546263
-rw-r--r-- | rbutil/rbutilqt/base/utils.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/rbutil/rbutilqt/base/utils.cpp b/rbutil/rbutilqt/base/utils.cpp index 5c80e1225c..60bacd709e 100644 --- a/rbutil/rbutilqt/base/utils.cpp +++ b/rbutil/rbutilqt/base/utils.cpp @@ -90,11 +90,12 @@ bool Utils::recursiveRmdir( const QString &dirName ) //! @return returns exact casing of path, empty string if path not found. QString Utils::resolvePathCase(QString path) { - QStringList elems; + int start; QString realpath; + QStringList elems = path.split("/", QString::SkipEmptyParts); - elems = path.split("/", QString::SkipEmptyParts); - int start; + if(path.isEmpty()) + return QString(); #if defined(Q_OS_WIN32) // on windows we must make sure to start with the first entry (i.e. the // drive letter) instead of a single / to make resolving work. |