diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-30 20:42:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-30 20:42:26 +0400 |
commit | 82fc02fb48e6015373f3c5c1425ffc8b80b16a05 (patch) | |
tree | 24be299da1261643918e54554c45785a3393fa88 | |
parent | 9c35147666898c5272438636bfc515d749f901b1 (diff) |
fix for own error in r43796, 'Find Missing Files', could set the path to an empty string.
-rw-r--r-- | source/blender/blenlib/intern/bpath.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c index f458c158fb2..ed2684befb1 100644 --- a/source/blender/blenlib/intern/bpath.c +++ b/source/blender/blenlib/intern/bpath.c @@ -191,12 +191,14 @@ void BLI_bpath_absolute_convert(Main *bmain, const char *basedir, ReportList *re data.count_tot, data.count_changed, data.count_failed); } -/* find this file recursively, use the biggest file so thumbnails don't get used by mistake - * - dir: subdir to search - * - filename: set this filename - * - filesize: filesize for the file +/** + * find this file recursively, use the biggest file so thumbnails don't get used by mistake + * \param filename_new: the path will be copied here, caller must initialize as empyu string. + * \param dirname: subdir to search + * \param filename: set this filename + * \param filesize: filesize for the file * - * return found: 1/0. + * \returns found: 1/0. */ #define MAX_RECUR 16 static int findFileRecursive(char *filename_new, @@ -213,8 +215,6 @@ static int findFileRecursive(char *filename_new, int size; int found = FALSE; - filename_new[0] = '\0'; - dir = opendir(dirname); if (dir == NULL) @@ -271,6 +271,8 @@ static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char int recur_depth = 0; int found; + filename_new[0] = '\0'; + found = findFileRecursive(filename_new, data->searchdir, BLI_path_basename((char *)path_src), &filesize, &recur_depth); |