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

This commit is contained in:
tastytea 2018-11-02 23:01:11 +01:00
parent 4785f8ce64
commit eb47e38444
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(xdgcfg
VERSION 0.2.1
VERSION 0.2.2
LANGUAGES CXX
)

View File

@ -21,10 +21,10 @@ xdgcfg::xdgcfg(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;
}