qdoc: Clean path names before using them
authorMartin Smith <martin.smith@nokia.com>
Thu, 12 Jul 2012 08:15:55 +0000 (10:15 +0200)
committerQt by Nokia <qt-info@nokia.com>
Thu, 12 Jul 2012 23:51:37 +0000 (01:51 +0200)
The excludedirs variable doesn't work correctly when its values have
'../' in them. The solution is to use QDir::cleanPath() on each path
name before using it.

Task Nr: QTBUG-26492

Change-Id: I2db74e79cf096c1c75ab5b10877320360c016fc7
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
src/tools/qdoc/config.cpp
src/tools/qdoc/location.cpp

index 7ab6570..e1a0283 100644 (file)
@@ -219,7 +219,6 @@ void Config::unload(const QString& fileName)
     }
     qDebug() << "fileName:" << fileName;
 }
-
 /*!
   Joins all the strings in \a values into a single string with the
   individual \a values separated by ' '. Then it inserts the result
@@ -931,11 +930,12 @@ void Config::load(Location location, const QString& fileName)
     }
 }
 
-QStringList Config::getFilesHere(const QString& dir,
+QStringList Config::getFilesHere(const QString& uncleanDir,
                                  const QString& nameFilter,
                                  const QSet<QString> &excludedDirs,
                                  const QSet<QString> &excludedFiles)
 {
+    QString dir = QDir::cleanPath(uncleanDir);
     QStringList result;
     if (excludedDirs.contains(dir))
         return result;
index 9cea232..630bf64 100644 (file)
@@ -60,7 +60,7 @@ QRegExp *Location::spuriousRegExp = 0;
 /*!
   \class Location
 
-  \brief The Location class keeps track of where we are in a file.
+  \brief The Location class provides a way to mark a location in a file.
 
   It maintains a stack of file positions. A file position
   consists of the file path, line number, and column number.