X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ffs%2Fosx%2Fdir_location.cpp;h=13aa3d2d500fd167153f16b4811f575004e517af;hb=1787d4928ac1285f5434a2c8d0676deea9ce9176;hp=7e9985b008228d25bce53ae5331839d4e933c428;hpb=9e98607f1b6a2c757de51fca6c1649cbdf536597;p=libs%2Fcore.git diff --git a/source/fs/osx/dir_location.cpp b/source/fs/osx/dir_location.cpp index 7e9985b..13aa3d2 100644 --- a/source/fs/osx/dir_location.cpp +++ b/source/fs/osx/dir_location.cpp @@ -1,4 +1,6 @@ #include +#include +#include #include "dir.h" using namespace std; @@ -16,23 +18,18 @@ Path get_home_dir() if(len) return string(buf, len); - const char *home = getenv("HOME"); - if(home) + string home = getenv("HOME"); + if(!home.empty()) return home; return "."; } -Path get_user_data_dir(const string &) -{ - return get_user_data_dir(); -} - Path get_user_data_dir() { const string &appname = Application::get_name(); if(appname.empty()) - throw logic_error("no application name"); + throw invalid_state("no application name"); char buf[1024]; unsigned len = get_application_support_dir(buf, sizeof(buf));