summaryrefslogtreecommitdiff
path: root/src/lib/cross.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-12-14 20:35:58 +0000
committerCarl Hetherington <cth@carlh.net>2018-12-14 20:35:58 +0000
commit1b1137dac3167de7e4bb23d86a4f3505ad880675 (patch)
tree24c8fcbdfa1e54d006e3e58e588a685697654d5f /src/lib/cross.cc
parentac5b373ab1f8d7cbc7b83aa05edec231bc1d956c (diff)
swaroop: fall back to home directory if the content directory is not present.
Diffstat (limited to 'src/lib/cross.cc')
-rw-r--r--src/lib/cross.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lib/cross.cc b/src/lib/cross.cc
index 61b150a3b..b9b215303 100644
--- a/src/lib/cross.cc
+++ b/src/lib/cross.cc
@@ -463,3 +463,14 @@ maybe_open_console ()
}
}
#endif
+
+boost::filesystem::path
+home_directory ()
+{
+#if defined(DCPOMATIC_LINUX) || defined(DCPOMATIC_OSX)
+ return getenv("HOME");
+#endif
+#ifdef DCPOMATIC_WINDOWS
+ return getenv("HOMEDRIVE") / getenv("HOMEPATH");
+#endif
+}