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/util.c')
-rw-r--r--source/blender/blenlib/intern/util.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c
index 838648ebfd7..a236defc515 100644
--- a/source/blender/blenlib/intern/util.c
+++ b/source/blender/blenlib/intern/util.c
@@ -494,6 +494,22 @@ void BLI_makestringcode(const char *relfile, char *file)
}
}
+int BLI_has_parent(char *path)
+{
+ int len;
+ int slashes = 0;
+ BLI_clean(path);
+ BLI_add_slash(path);
+
+ len = strlen(path)-1;
+ while (len) {
+ if ((path[len] == '\\') || (path[len] == '/'))
+ slashes++;
+ len--;
+ }
+ return slashes > 1;
+}
+
int BLI_parent_dir(char *path)
{
#ifdef WIN32