X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fdir.cpp;h=0b6873277d4feb014d76df62afdde602d0679698;hp=2ae5122e63768492f54274a7b7062e861445a094;hb=2a6afe61db5603d508468adbd538ad4e96acc3fc;hpb=d08f1d5d468beb303a4bd80f7e37169c464cf942 diff --git a/source/fs/dir.cpp b/source/fs/dir.cpp index 2ae5122..0b68732 100644 --- a/source/fs/dir.cpp +++ b/source/fs/dir.cpp @@ -17,6 +17,15 @@ namespace FS { namespace { +enum +{ +#ifdef WIN32 + ITEMSEP = ';' +#else + ITEMSEP = ':' +#endif +}; + /** 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 string &argv0) @@ -30,7 +39,7 @@ const Path &get_bin_dir(const string &argv0) if(argv0.find('/')==string::npos) { const char *path = getenv("PATH"); - vector dirs = split(path, ':'); + vector dirs = split(path, ITEMSEP); for(vector::const_iterator i=dirs.begin(); i!=dirs.end(); ++i) if(exists(Path(*i)/argv0)) {