From ef0e303235c03811eb29bc17e71f22ebdce95356 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 19 Sep 2021 18:06:47 +0200 Subject: [PATCH] App: handle empty, . or .. as parent directory --- src/App/Document.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App/Document.cpp b/src/App/Document.cpp index aa099d216a..3abcde08b5 100644 --- a/src/App/Document.cpp +++ b/src/App/Document.cpp @@ -2614,7 +2614,9 @@ bool Document::saveToFile(const char* filename) const } Base::FileInfo tmp(fn); // In case some folders in the path do not exist - fs::create_directories(fs::path(filename).parent_path()); + fs::path parent = fs::path(filename).parent_path(); + if (!parent.empty() && !parent.filename_is_dot() && !parent.filename_is_dot_dot()) + fs::create_directories(parent); // open extra scope to close ZipWriter properly {