[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49401] trunk/blender/source/blender/ blenlib/intern/bpath.c: fix for own error in r43796, 'Find Missing Files', could set the path to an empty string.

Campbell Barton ideasman42 at gmail.com
Mon Jul 30 18:42:26 CEST 2012


Revision: 49401
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49401
Author:   campbellbarton
Date:     2012-07-30 16:42:26 +0000 (Mon, 30 Jul 2012)
Log Message:
-----------
fix for own error in r43796, 'Find Missing Files', could set the path to an empty string.

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43796

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/bpath.c

Modified: trunk/blender/source/blender/blenlib/intern/bpath.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/bpath.c	2012-07-30 16:40:23 UTC (rev 49400)
+++ trunk/blender/source/blender/blenlib/intern/bpath.c	2012-07-30 16:42:26 UTC (rev 49401)
@@ -191,12 +191,14 @@
 	            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 @@
 	int size;
 	int found = FALSE;
 
-	filename_new[0] = '\0';
-
 	dir = opendir(dirname);
 
 	if (dir == NULL)
@@ -271,6 +271,8 @@
 	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);




More information about the Bf-blender-cvs mailing list