From d563b1173ba319c1f26c656a55ed2507e06e0519 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 11 Mar 2015 12:12:08 -0500 Subject: [PATCH] only create user configuration directory if no explicit version was given --- libs/ardour/filesystem_paths.cc | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/libs/ardour/filesystem_paths.cc b/libs/ardour/filesystem_paths.cc index c07acb0280..50ef0be314 100644 --- a/libs/ardour/filesystem_paths.cc +++ b/libs/ardour/filesystem_paths.cc @@ -98,16 +98,21 @@ user_config_directory (int version) p = Glib::build_filename (p, user_config_directory_name (version)); - if (!Glib::file_test (p, Glib::FILE_TEST_EXISTS)) { - if (g_mkdir_with_parents (p.c_str(), 0755)) { - error << string_compose (_("Cannot create Configuration directory %1 - cannot run"), - p) << endmsg; + if (version < 0) { + /* Only create the user config dir if the version was negative, + meaning "for the current version. + */ + if (!Glib::file_test (p, Glib::FILE_TEST_EXISTS)) { + if (g_mkdir_with_parents (p.c_str(), 0755)) { + error << string_compose (_("Cannot create Configuration directory %1 - cannot run"), + p) << endmsg; + exit (1); + } + } else if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) { + error << string_compose (_("Configuration directory %1 already exists and is not a directory/folder - cannot run"), + p) << endmsg; exit (1); } - } else if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) { - error << string_compose (_("Configuration directory %1 already exists and is not a directory/folder - cannot run"), - p) << endmsg; - exit (1); } return p;