summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-08-27 13:45:46 +0100
committerCarl Hetherington <cth@carlh.net>2015-08-27 13:45:46 +0100
commitaa36b8c781059aa573a1465692bc9ae5973253f1 (patch)
tree08905d7288dedf163f8b93914aaf1ed83cf7aa20
parentf60eb6a4f6b75a78899bbc96213450ac49d74e33 (diff)
Make sure we don't create any config directories until we've set up the i18n properly.
-rw-r--r--ChangeLog5
-rw-r--r--src/lib/config.cc8
-rw-r--r--src/lib/config.h2
3 files changed, 11 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 6af9eb3c9..f043d95b3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-08-27 Carl Hetherington <cth@carlh.net>
+
+ * Fix creation of badly-named configuration
+ directories in some circumstances (#654).
+
2015-08-26 Carl Hetherington <cth@carlh.net>
* Version 2.1.46 released.
diff --git a/src/lib/config.cc b/src/lib/config.cc
index cec054aaa..4995793e9 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -269,7 +269,7 @@ Config::read ()
/** @return Filename to write configuration to */
boost::filesystem::path
-Config::file ()
+Config::file (bool create_directories)
{
boost::filesystem::path p;
#ifdef DCPOMATIC_OSX
@@ -283,7 +283,9 @@ Config::file ()
p /= "dcpomatic2";
#endif
boost::system::error_code ec;
- boost::filesystem::create_directories (p, ec);
+ if (create_directories) {
+ boost::filesystem::create_directories (p, ec);
+ }
p /= "config.xml";
return p;
}
@@ -468,5 +470,5 @@ Config::add_to_history (boost::filesystem::path p)
bool
Config::have_existing ()
{
- return boost::filesystem::exists (file ());
+ return boost::filesystem::exists (file (false));
}
diff --git a/src/lib/config.h b/src/lib/config.h
index 9d583ff6d..fc63c518c 100644
--- a/src/lib/config.h
+++ b/src/lib/config.h
@@ -432,7 +432,7 @@ public:
private:
Config ();
- static boost::filesystem::path file ();
+ static boost::filesystem::path file (bool create_directories = true);
void read ();
void set_defaults ();
void set_kdm_email_to_default ();