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')
-rw-r--r--source/blender/blenlib/intern/bpath.c5
-rw-r--r--source/blender/blenlib/intern/path_util.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 9b1d29e6e12..a56cbb65538 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -661,7 +661,7 @@ void findMissingFiles(char *basepath, char *str) {
char filepath[FILE_MAX], *libpath;
int filesize, recur_depth;
- char dirname[FILE_MAX], filename[FILE_MAX], filename_new[FILE_MAX];
+ char dirname[FILE_MAX], filename_new[FILE_MAX];
//XXX waitcursor( 1 );
@@ -686,9 +686,8 @@ void findMissingFiles(char *basepath, char *str) {
/* can the dir be opened? */
filesize = -1;
recur_depth = 0;
- BLI_split_dirfile(filepath, NULL, filename); /* the file to find */
- findFileRecursive(filename_new, dirname, filename, &filesize, &recur_depth);
+ findFileRecursive(filename_new, dirname, BLI_path_basename(filepath), &filesize, &recur_depth);
if (filesize == -1) { /* could not open dir */
printf("Could not open dir \"%s\"\n", dirname);
return;
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index 301b981cdc7..f91c38b8271 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1172,6 +1172,12 @@ void BLI_join_dirfile(char *string, const char *dir, const char *file)
}
}
+/* like pythons os.path.basename( ) */
+char *BLI_path_basename(char *path)
+{
+ const char *filename= BLI_last_slash(path);
+ return filename ? filename + 1 : path;
+}
/*
Produce image export path.