From 4390be2f80262525eedcf48686d560582d998a9e Mon Sep 17 00:00:00 2001 From: Tomasz Iwanek Date: Tue, 16 Jun 2015 11:46:21 +0200 Subject: [PATCH] Fix dfsCheckDirectories 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vcore/src/vcore/ReferenceValidator.cpp b/vcore/src/vcore/ReferenceValidator.cpp index e1a9532..e99436c 100644 --- a/vcore/src/vcore/ReferenceValidator.cpp +++ b/vcore/src/vcore/ReferenceValidator.cpp @@ -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()); -- 2.7.4