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')
-rw-r--r--source/blender/blenlib/intern/fileops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c
index 76437720e45..ebd8f4be1cf 100644
--- a/source/blender/blenlib/intern/fileops.c
+++ b/source/blender/blenlib/intern/fileops.c
@@ -95,12 +95,12 @@ char *BLI_last_slash(const char *string) {
void BLI_add_slash(char *string) {
int len = strlen(string);
#ifdef WIN32
- if (string[len-1]!='\\') {
+ if (len==0 || string[len-1]!='\\') {
string[len] = '\\';
string[len+1] = '\0';
}
#else
- if (string[len-1]!='/') {
+ if (len==0 || string[len-1]!='/') {
string[len] = '/';
string[len+1] = '\0';
}