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/blenlib/intern/path_util.c')
-rw-r--r--source/blender/blenlib/intern/path_util.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 47afb60761f..202ea5b1a34 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1258,9 +1258,18 @@ void BLI_make_file_string(const char *relabase, char *string, const char *dir,
{
int sl;
- if (!string || !dir || !file) return; /* We don't want any NULLs */
-
- string[0]= 0; /* ton */
+ if (string) {
+ /* ensure this is always set even if dir/file are NULL */
+ string[0]= '\0';
+
+ if (ELEM(NULL, dir, file)) {
+ return; /* We don't want any NULLs */
+ }
+ }
+ else {
+ return; /* string is NULL, probably shouldnt happen but return anyway */
+ }
+
/* we first push all slashes into unix mode, just to make sure we don't get
any mess with slashes later on. -jesterKing */