diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-04-26 10:13:49 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-04-26 10:13:49 +0100 |
| commit | 56abd650a3e915c398db8dbeaf5260452234ac9f (patch) | |
| tree | f430b2122488d3cb56d2e2516caa1102b20fd7ee /src/lib | |
| parent | 1bb2e84e9a0037b95bd938abf0955176058a5977 (diff) | |
Copy config.xml and cinemas.xml if they fail to load so data is not lost.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/config.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc index 01a67522f..10bee140c 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -323,6 +323,13 @@ try } catch (...) { if (have_existing ("config.xml")) { + + /* Make a copy of the configuration */ + try { + boost::filesystem::copy (path ("config.xml", false), path ("config.xml.backup", false)); + boost::filesystem::copy (path ("cinemas.xml", false), path ("cinemas.xml.backup", false)); + } catch (...) {} + /* We have a config file but it didn't load */ FailedToLoad (); } |
