summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2012-05-11 22:05:09 +0200
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2012-05-11 22:07:34 +0200
commit4b5348ba04a62335757d439aa1acb8a3579c267d (patch)
tree17a7dcf303d299f88417c5f0c90fec84df6e5d78
parentfbe9ccc85cbbd4355415694990fe58003c5c2beb (diff)
downloadrockbox-4b5348ba04a62335757d439aa1acb8a3579c267d.tar.gz
rockbox-4b5348ba04a62335757d439aa1acb8a3579c267d.zip
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.cpp7
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 )
90//! @return returns exact casing of path, empty string if path not found. 90//! @return returns exact casing of path, empty string if path not found.
91QString Utils::resolvePathCase(QString path) 91QString Utils::resolvePathCase(QString path)
92{ 92{
93 QStringList elems; 93 int start;
94 QString realpath; 94 QString realpath;
95 QStringList elems = path.split("/", QString::SkipEmptyParts);
95 96
96 elems = path.split("/", QString::SkipEmptyParts); 97 if(path.isEmpty())
97 int start; 98 return QString();
98#if defined(Q_OS_WIN32) 99#if defined(Q_OS_WIN32)
99 // on windows we must make sure to start with the first entry (i.e. the 100 // on windows we must make sure to start with the first entry (i.e. the
100 // drive letter) instead of a single / to make resolving work. 101 // drive letter) instead of a single / to make resolving work.