Fix dfsCheckDirectories 48/41848/1
authorTomasz Iwanek <t.iwanek@samsung.com>
Tue, 16 Jun 2015 09:46:21 +0000 (11:46 +0200)
committerTomasz Iwanek <t.iwanek@samsung.com>
Tue, 16 Jun 2015 09:46:38 +0000 (11:46 +0200)
In ReferenceValidator::Impl::dfsCheckDirectories.

There is no guaranteed that m_dirpath path has ending slash mark.
We need to append slash to correctly construct path.

Change-Id: I057615c935445d7eff2b21e74ce29c3210bb2cee

vcore/src/vcore/ReferenceValidator.cpp

index e1a9532..e99436c 100644 (file)
@@ -138,7 +138,11 @@ ReferenceValidator::Result ReferenceValidator::Impl::dfsCheckDirectories(
 {
     DIR *dp;
     struct dirent *dirp;
-    std::string currentDir = m_dirpath + directory;
+    std::string currentDir = m_dirpath;
+    if (!directory.empty()) {
+        currentDir += "/";
+        currentDir += directory;
+    }
 
     if ((dp = opendir(currentDir.c_str())) == NULL) {
         LogError("Error opening directory: " << currentDir.c_str());