minor adjustment to BLI_uniquename, the last extension is used so "A.B.001" -->...
authorCampbell Barton <ideasman42@gmail.com>
Tue, 16 Feb 2010 18:03:10 +0000 (18:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 16 Feb 2010 18:03:10 +0000 (18:03 +0000)
source/blender/blenlib/intern/path_util.c

index 8d5df59..2703de1 100644 (file)
@@ -257,12 +257,12 @@ void BLI_uniquename(ListBase *list, void *vlink, const char defname[], char deli
                return;
 
        /* Strip off the suffix */
-       dot = strchr(GIVE_STRADDR(vlink, name_offs), delim);
+       dot = strrchr(GIVE_STRADDR(vlink, name_offs), delim);
        if (dot)
                *dot=0;
        
        for (number = 1; number <= 999; number++) {
-               BLI_snprintf(tempname, 128, "%s%c%03d", GIVE_STRADDR(vlink, name_offs), delim, number);
+               BLI_snprintf(tempname, sizeof(tempname), "%s%c%03d", GIVE_STRADDR(vlink, name_offs), delim, number);
                
                exists = 0;
                for (link= list->first; link; link= link->next) {