Fixed bug: Parent directories were only created if subdir was non-empty

This commit is contained in:
tastytea 2018-11-02 23:21:17 +01:00
parent 13aec7c2b4
commit b92d0135b9
Signed by: tastytea
GPG Key ID: CFC39497F1B26E07
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,6 @@
cmake_minimum_required (VERSION 3.7)
project(xdgjson
VERSION 0.2.1
VERSION 0.2.2
LANGUAGES CXX
)

View File

@ -18,10 +18,10 @@ xdgjson::xdgjson(const string &filename, const string &subdir)
if (!subdir.empty())
{
_filepath /= subdir;
if (!fs::exists(_filepath))
{
fs::create_directories(_filepath);
}
}
if (!fs::exists(_filepath))
{
fs::create_directories(_filepath);
}
_filepath /= filename;
}