From 483ca717825e619e2b212e731156151ffe66ffed Mon Sep 17 00:00:00 2001 From: niklaspandersson Date: Thu, 11 Apr 2013 16:41:12 +0200 Subject: [PATCH] added code to ensure that environment-paths (log, data, media, etc) always end with a backslash --- common/env.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/common/env.cpp b/common/env.cpp index 6534bc052..1d0361ad5 100644 --- a/common/env.cpp +++ b/common/env.cpp @@ -70,6 +70,18 @@ void configure(const std::wstring& filename) data = widen(paths.get(L"data-path", initialPath + L"\\data\\")); thumbnails = widen(paths.get(L"thumbnails-path", initialPath + L"\\thumbnails\\")); + //Make sure that all paths have a trailing backslash + if(media.at(media.length()-1) != L'\\') + media.append(L"\\"); + if(log.at(log.length()-1) != L'\\') + log.append(L"\\"); + if(ftemplate.at(ftemplate.length()-1) != L'\\') + ftemplate.append(L"\\"); + if(data.at(data.length()-1) != L'\\') + data.append(L"\\"); + if(thumbnails.at(thumbnails.length()-1) != L'\\') + thumbnails.append(L"\\"); + try { for(auto it = boost::filesystem2::wdirectory_iterator(initialPath); it != boost::filesystem2::wdirectory_iterator(); ++it) -- 2.39.5