diff --git a/src/PlatformUtils-posix.cc b/src/PlatformUtils-posix.cc index d7b7b6d6..d2b87927 100644 --- a/src/PlatformUtils-posix.cc +++ b/src/PlatformUtils-posix.cc @@ -3,8 +3,13 @@ std::string PlatformUtils::documentsPath() { - fs::path docpath(getenv("HOME")); - docpath = docpath / ".local" / "share"; - - return boosty::stringy(docpath); + const char *home = getenv("HOME"); + if (home) { + fs::path docpath(home); + docpath = docpath / ".local" / "share"; + return boosty::stringy(docpath); + } + else { + return ""; + } } diff --git a/src/primitives.cc b/src/primitives.cc index 45ea7d8e..0c2bfd52 100644 --- a/src/primitives.cc +++ b/src/primitives.cc @@ -40,6 +40,8 @@ #include #include using namespace boost::assign; // bring 'operator+=()' into scope + +#include using boost::math::isinf; #define F_MINIMUM 0.01