diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-29 14:32:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-29 14:32:38 +0400 |
commit | 635db3b3066b71d4c9c0f4a67d20aeff0d4b3810 (patch) | |
tree | 8ff6739fe6fadda6ed96141c024575f13e4ccf3d /source/blender/blenkernel/intern | |
parent | 1d9eaad73ae1ce8ddfbef68ffbf8c56ac06ac0ce (diff) |
code cleanup: add utility function BLI_path_is_rel()
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pointcache.c | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index e073cfdf76d..9f770e0a9a7 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1528,7 +1528,7 @@ void BKE_library_filepath_set(Library *lib, const char *filepath) /* not essential but set filepath is an absolute copy of value which * is more useful if its kept in sync */ - if (strncmp(lib->filepath, "//", 2) == 0) { + if (BLI_path_is_rel(lib->filepath)) { /* note that the file may be unsaved, in this case, setting the * filepath on an indirectly linked path is not allowed from the * outliner, and its not really supported but allow from here for now diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index e990f461d4c..1588ec10b55 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -1067,8 +1067,9 @@ static int ptcache_path(PTCacheID *pid, char *filename) if (pid->cache->flag & PTCACHE_EXTERNAL) { strcpy(filename, pid->cache->path); - if (strncmp(filename, "//", 2)==0) + if (BLI_path_is_rel(filename)) { BLI_path_abs(filename, blendfilename); + } return BLI_add_slash(filename); /* new strlen() */ } |