summaryrefslogtreecommitdiff
path: root/libs/ardour/filesystem_paths.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2015-03-11 12:12:08 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2015-03-11 13:24:47 -0500
commitd563b1173ba319c1f26c656a55ed2507e06e0519 (patch)
treeb1e4b1193d97fef2d24a77837b397dd947d42427 /libs/ardour/filesystem_paths.cc
parentc9d10158f6153c31be73a04cdc5c8c2d2df412e7 (diff)
only create user configuration directory if no explicit version was given
Diffstat (limited to 'libs/ardour/filesystem_paths.cc')
-rw-r--r--libs/ardour/filesystem_paths.cc21
1 files 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;