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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2010-01-17 19:00:54 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-01-17 19:00:54 +0300
commite682febe24fdf73e92ab59ad9938f77d821097bf (patch)
tree1e49be0d22b38b26a1a5e40e52413f5dc479238c /source
parent870df309c52a582d94f847c13a6166699e3b781c (diff)
fix for own bug in name flipping, was modifying the original name (very bad!).
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/deform.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/deform.c b/source/blender/blenkernel/intern/deform.c
index 620e114bad2..c4d5f4952b6 100644
--- a/source/blender/blenkernel/intern/deform.c
+++ b/source/blender/blenkernel/intern/deform.c
@@ -285,7 +285,7 @@ void unique_vertexgroup_name (bDeformGroup *dg, Object *ob)
/* finds the best possible flipped name. For renaming; check for unique names afterwards */
/* if strip_number: removes number extensions */
-void flip_vertexgroup_name (char *name_r, const char *name, int strip_number)
+void flip_vertexgroup_name (char *name, const char *from_name, int strip_number)
{
int len;
char prefix[sizeof((bDeformGroup *)NULL)->name]={""}; /* The part before the facing */
@@ -294,9 +294,11 @@ void flip_vertexgroup_name (char *name_r, const char *name, int strip_number)
char number[sizeof((bDeformGroup *)NULL)->name]={""}; /* The number extension string */
char *index=NULL;
- len= strlen(name);
+ len= strlen(from_name);
if(len<3) return; // we don't do names like .R or .L
+ strcpy(name, from_name);
+
/* We first check the case with a .### extension, let's find the last period */
if(isdigit(name[len-1])) {
index= strrchr(name, '.'); // last occurrence
@@ -392,7 +394,7 @@ void flip_vertexgroup_name (char *name_r, const char *name, int strip_number)
#undef IS_SEPARATOR
- sprintf (name_r, "%s%s%s%s", prefix, replace, suffix, number);
+ sprintf (name, "%s%s%s%s", prefix, replace, suffix, number);
}