Revision: 37214 http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37214 Author: campbellbarton Date: 2011-06-05 15:29:50 +0000 (Sun, 05 Jun 2011) Log Message: ----------- own commit r37199 gave problems with duplicating objects, use different fix.
Revision Links: -------------- http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37199 Modified Paths: -------------- trunk/blender/source/blender/blenlib/intern/path_util.c Modified: trunk/blender/source/blender/blenlib/intern/path_util.c =================================================================== --- trunk/blender/source/blender/blenlib/intern/path_util.c 2011-06-05 15:25:43 UTC (rev 37213) +++ trunk/blender/source/blender/blenlib/intern/path_util.c 2011-06-05 15:29:50 UTC (rev 37214) @@ -156,7 +156,7 @@ /* could use '0', but this would mean the first * duplicate would become FooBar.000 */ - *nr= 1; + *nr= 0; a= strlen(name); memcpy(left, name, (a + 1) * sizeof(char)); @@ -218,13 +218,13 @@ int number; int len= BLI_split_name_num(left, &number, name, delim); do { - int newlen= BLI_snprintf(tempname, name_len, "%s%c%03d", left, delim, number); + int newlen= BLI_snprintf(tempname, name_len, "%s%c%03d", left, delim, ++number); if(newlen >= name_len) { len -= ((newlen + 1) - name_len); if(len < 0) len= number= 0; left[len]= '\0'; } - } while(number++, unique_check(arg, tempname)); + } while(unique_check(arg, tempname)); BLI_strncpy(name, tempname, name_len); _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs