diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-24 00:10:22 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-24 00:10:22 +0400 |
commit | 7dde3551853018147d99e9454abb337384e7a32e (patch) | |
tree | a0255cc50e7621d8387baf68af03bc0a6366ce6a /source/blender/makesrna/intern/rna_texture.c | |
parent | 9afdda36893276321f7da9af94babf7a5b7b62fe (diff) |
fix [#34958] keyframe many items would fail if there was a (") in the text.
Diffstat (limited to 'source/blender/makesrna/intern/rna_texture.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_texture.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_texture.c b/source/blender/makesrna/intern/rna_texture.c index e57d9586a32..d01eab053bd 100644 --- a/source/blender/makesrna/intern/rna_texture.c +++ b/source/blender/makesrna/intern/rna_texture.c @@ -307,10 +307,15 @@ char *rna_TextureSlot_path(PointerRNA *ptr) } /* this is a compromise for the remaining cases... */ - if (mtex->tex) - return BLI_sprintfN("texture_slots[\"%s\"]", mtex->tex->id.name + 2); - else + if (mtex->tex) { + char name_esc[(sizeof(mtex->tex->id.name) - 2) * 2]; + + BLI_strescape(name_esc, mtex->tex->id.name + 2, sizeof(name_esc)); + return BLI_sprintfN("texture_slots[\"%s\"]", name_esc); + } + else { return BLI_strdup("texture_slots[0]"); + } } static int rna_TextureSlot_name_length(PointerRNA *ptr) |