From eb47e384442ced9a27c1194cb86890117b13e09f Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 2 Nov 2018 23:01:11 +0100 Subject: [PATCH] Fixed bug: Parent directories were only created if subdir was non-empty --- CMakeLists.txt | 2 +- src/xdgcfg.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3df539d..eddb3dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.7) project(xdgcfg - VERSION 0.2.1 + VERSION 0.2.2 LANGUAGES CXX ) diff --git a/src/xdgcfg.cpp b/src/xdgcfg.cpp index 156cb36..ea58b17 100644 --- a/src/xdgcfg.cpp +++ b/src/xdgcfg.cpp @@ -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; }