X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fdir.cpp;h=29c24c188fa96b7d76763b9b1ab5ad4a8aa3de53;hp=09a89f1f1f29def46e0de231deb6a309a0669140;hb=9c48f72f02e3112f4193cc8b3f12b135aa483de1;hpb=a2a494043d5cf228cf1b3e5551e3abb486a60191 diff --git a/source/dir.cpp b/source/dir.cpp index 09a89f1..29c24c1 100644 --- a/source/dir.cpp +++ b/source/dir.cpp @@ -32,15 +32,15 @@ namespace Helper function to determine the location of the program's executable. Caches the last result to cut down filesystem access with repeated calls. */ -const Path &get_bin_dir(const Path &argv0) +const Path &get_bin_dir(const string &argv0) { - static Path last_argv0; + static string last_argv0; static Path bin_dir; if(!(argv0==last_argv0)) { Path exe; - if(argv0.size()==1) + if(argv0.find('/')==string::npos) { const char *path=getenv("PATH"); vector dirs=split(path, ':'); @@ -184,7 +184,7 @@ Path get_user_data_dir(const string &appname) #endif } -Path get_sys_conf_dir(const Path &argv0) +Path get_sys_conf_dir(const string &argv0) { Path dir=get_bin_dir(argv0); @@ -199,7 +199,7 @@ Path get_sys_conf_dir(const Path &argv0) return dir; } -Path get_sys_data_dir(const Path &argv0, const string &appname) +Path get_sys_data_dir(const string &argv0, const string &appname) { Path dir=get_bin_dir(argv0);