Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/util/path.cpp
| Show First 20 Lines • Show All 307 Lines • ▼ Show 20 Lines | if (!env_init) { | ||||
| env_shader_path = getenv("CYCLES_SHADER_PATH"); | env_shader_path = getenv("CYCLES_SHADER_PATH"); | ||||
| /* NOTE: It is KERNEL in env variable for compatibility reasons. */ | /* NOTE: It is KERNEL in env variable for compatibility reasons. */ | ||||
| env_source_path = getenv("CYCLES_KERNEL_PATH"); | env_source_path = getenv("CYCLES_KERNEL_PATH"); | ||||
| env_init = true; | env_init = true; | ||||
| } | } | ||||
| if (env_shader_path != NULL && sub == "shader") { | if (env_shader_path != NULL && sub == "shader") { | ||||
| return env_shader_path; | return env_shader_path; | ||||
| } | } | ||||
| else if (env_shader_path != NULL && sub == "source") { | else if (env_source_path != NULL && sub == "source") { | ||||
| return env_source_path; | return env_source_path; | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| #if defined(__linux__) || defined(__APPLE__) | #if defined(__linux__) || defined(__APPLE__) | ||||
| static string path_xdg_cache_get() | static string path_xdg_cache_get() | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 211 Lines • ▼ Show 20 Lines | static string path_make_compatible(const string &path) | ||||
| /* In Windows stat() doesn't recognize dir ending on a slash. */ | /* In Windows stat() doesn't recognize dir ending on a slash. */ | ||||
| if (result.size() > 3 && result[result.size() - 1] == DIR_SEP) { | if (result.size() > 3 && result[result.size() - 1] == DIR_SEP) { | ||||
| result.resize(result.size() - 1); | result.resize(result.size() - 1); | ||||
| } | } | ||||
| /* Clean up UNC path. */ | /* Clean up UNC path. */ | ||||
| if ((path.size() >= 3) && (path[0] == DIR_SEP) && (path[1] == DIR_SEP)) { | if ((path.size() >= 3) && (path[0] == DIR_SEP) && (path[1] == DIR_SEP)) { | ||||
| result = path_cleanup_unc(result); | result = path_cleanup_unc(result); | ||||
| } | } | ||||
| /* Make sure volume-only path ends up wit ha directory separator. */ | /* Make sure volume-only path ends up wit a directory separator. */ | ||||
| if (result.size() == 2 && result[1] == ':') { | if (result.size() == 2 && result[1] == ':') { | ||||
| result += DIR_SEP; | result += DIR_SEP; | ||||
| } | } | ||||
| return result; | return result; | ||||
| } | } | ||||
| static int path_wstat(const wstring &path_wc, path_stat_t *st) | static int path_wstat(const wstring &path_wc, path_stat_t *st) | ||||
| { | { | ||||
| ▲ Show 20 Lines • Show All 229 Lines • Show Last 20 Lines | |||||