From 7dde3551853018147d99e9454abb337384e7a32e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 23 Apr 2013 20:10:22 +0000 Subject: fix [#34958] keyframe many items would fail if there was a (") in the text. --- source/blender/makesrna/intern/rna_texture.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'source/blender/makesrna/intern/rna_texture.c') 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) -- cgit v1.2.3