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:
authorCampbell Barton <ideasman42@gmail.com>2013-08-07 12:20:37 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-08-07 12:20:37 +0400
commit9bfbdd8118611059fe46ac4bb92d0a5b9a05741d (patch)
tree30fed66ff233e7ed560aab79006825dacdef348d /source/blender/blenkernel/intern/library.c
parent29c8e4512c2deda8e37f503f30c5a89f20e21a45 (diff)
remove assert in check_for_dupid() function for rare but valid renaming situation.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 7eb4a3a2a8d..c23fa097d3e 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -1264,17 +1264,13 @@ static ID *is_dupid(ListBase *lb, ID *id, const char *name)
static bool check_for_dupid(ListBase *lb, ID *id, char *name)
{
ID *idtest;
- int nr = 0, nrtest, a, left_len;
+ int nr = 0, a, left_len;
#define MAX_IN_USE 64
bool in_use[MAX_IN_USE];
/* to speed up finding unused numbers within [1 .. MAX_IN_USE - 1] */
char left[MAX_ID_NAME + 8], leftest[MAX_ID_NAME + 8];
- /* make sure input name is terminated properly */
- /* if ( strlen(name) > MAX_ID_NAME-3 ) name[MAX_ID_NAME-3] = 0; */
- /* removed since this is only ever called from one place - campbell */
-
while (true) {
/* phase 1: id already exists? */
@@ -1301,6 +1297,7 @@ static bool check_for_dupid(ListBase *lb, ID *id, char *name)
}
for (idtest = lb->first; idtest; idtest = idtest->next) {
+ int nrtest;
if ( (id != idtest) &&
(idtest->lib == NULL) &&
(*name == *(idtest->name + 2)) &&
@@ -1315,8 +1312,8 @@ static bool check_for_dupid(ListBase *lb, ID *id, char *name)
nr = nrtest + 1; /* track largest unused */
}
}
- /* At this point, nr will be at least 1. */
- BLI_assert(nr >= 1);
+ /* At this point, 'nr' will typically be at least 1. (but not always) */
+ // BLI_assert(nr >= 1);
/* decide which value of nr to use */
for (a = 0; a < MAX_IN_USE; a++) {