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>2010-07-14 16:16:23 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-07-14 16:16:23 +0400
commitae1748b98470f08ed805e101b218f44c17d9b6b2 (patch)
tree5cbfb0be44424d1fcd263edf4eea5a355f07281c
parent80355fd456cbdb87d0b88a668796d68a0b66c0b2 (diff)
bugfix [#22847] 18+ char Name in Edit Strip causes errors when duplicating strips
-rw-r--r--source/blender/blenkernel/intern/sequencer.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index e8f8c2f3c3b..d97e6151a13 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -795,7 +795,7 @@ static void seqbase_unique_name(ListBase *seqbasep, SeqUniqueInfo *sui)
Sequence *seq;
for(seq=seqbasep->first; seq; seq= seq->next) {
if (sui->seq != seq && strcmp(sui->name_dest, seq->name+2)==0) {
- sprintf(sui->name_dest, "%.18s.%03d", sui->name_src, sui->count++);
+ sprintf(sui->name_dest, "%.17s.%03d", sui->name_src, sui->count++); /*24 - 2 for prefix, -1 for \0 */
sui->match= 1; /* be sure to re-scan */
}
}
@@ -816,12 +816,17 @@ void seqbase_unique_name_recursive(ListBase *seqbasep, struct Sequence *seq)
strcpy(sui.name_src, seq->name+2);
strcpy(sui.name_dest, seq->name+2);
+ sui.count= 1;
+ sui.match= 1; /* assume the worst to start the loop */
+
/* Strip off the suffix */
- if ((dot=strrchr(sui.name_src, '.')))
+ if ((dot=strrchr(sui.name_src, '.'))) {
*dot= '\0';
+ dot++;
- sui.count= 1;
- sui.match= 1; /* assume the worst to start the loop */
+ if(*dot)
+ sui.count= atoi(dot) + 1;
+ }
while(sui.match) {
sui.match= 0;