Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/appdir.c')
-rw-r--r--source/blender/blenkernel/intern/appdir.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
index 44fc608530b..2038079744d 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -109,6 +109,7 @@ static bool is_appdir_init = false;
void BKE_appdir_init(void)
{
#ifndef NDEBUG
+ BLI_assert(is_appdir_init == false);
is_appdir_init = true;
#endif
}
@@ -254,8 +255,12 @@ static bool test_path(char *targetpath,
}
/**
- * Puts the value of the specified environment variable into *path if it exists
- * and points at a directory. Returns true if this was done.
+ * Puts the value of the specified environment variable into \a path if it exists.
+ *
+ * \param check_is_dir: When true, checks if it points at a directory.
+ *
+ * \returns true when the value of the environment variable is stored
+ * at the address \a path points to.
*/
static bool test_env_path(char *path, const char *envvar, const bool check_is_dir)
{
@@ -266,13 +271,14 @@ static bool test_env_path(char *path, const char *envvar, const bool check_is_di
return false;
}
+ BLI_strncpy(path, env_path, FILE_MAX);
+
if (check_is_dir == false) {
CLOG_INFO(&LOG, 3, "using env '%s' without test: '%s'", envvar, env_path);
return true;
}
if (BLI_is_dir(env_path)) {
- BLI_strncpy(path, env_path, FILE_MAX);
CLOG_INFO(&LOG, 3, "env '%s' found: %s", envvar, env_path);
return true;
}