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/blenlib/intern/bpath.c | |
parent | 1d9eaad73ae1ce8ddfbef68ffbf8c56ac06ac0ce (diff) |
code cleanup: add utility function BLI_path_is_rel()
Diffstat (limited to 'source/blender/blenlib/intern/bpath.c')
-rw-r--r-- | source/blender/blenlib/intern/bpath.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index 6d95b078340..2a750cb1a66 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -113,13 +113,13 @@ static int makeFilesRelative_visit_cb(void *userdata, char *path_dst, const char data->count_tot++; - if (strncmp(path_src, "//", 2) == 0) { + if (BLI_path_is_rel(path_src)) { return FALSE; /* already relative */ } else { strcpy(path_dst, path_src); BLI_path_rel(path_dst, data->basedir); - if (strncmp(path_dst, "//", 2) == 0) { + if (BLI_path_is_rel(path_dst)) { data->count_changed++; } else { @@ -155,13 +155,13 @@ static int makeFilesAbsolute_visit_cb(void *userdata, char *path_dst, const char data->count_tot++; - if (strncmp(path_src, "//", 2) != 0) { + if (BLI_path_is_rel(path_src) == FALSE) { return FALSE; /* already absolute */ } else { strcpy(path_dst, path_src); BLI_path_abs(path_dst, data->basedir); - if (strncmp(path_dst, "//", 2) != 0) { + if (BLI_path_is_rel(path_dst) == FALSE) { data->count_changed++; } else { @@ -596,7 +596,7 @@ int BLI_bpath_relocate_visitor(void *pathbase_v, char *path_dst, const char *pat const char *base_new = ((char **)pathbase_v)[0]; const char *base_old = ((char **)pathbase_v)[1]; - if (strncmp(base_old, "//", 2) == 0) { + if (BLI_path_is_rel(base_old)) { printf("%s: error, old base path '%s' is not absolute.\n", __func__, base_old); return FALSE; |