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:
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 88447f6dd77..bc6e17a689d 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -2106,7 +2106,7 @@ char *RNA_property_string_get_alloc(PointerRNA *ptr, PropertyRNA *prop, char *fi
if(length+1 < fixedlen)
buf= fixedbuf;
else
- buf= MEM_callocN(sizeof(char)*(length+1), "RNA_string_get_alloc");
+ buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_string_get_alloc");
RNA_property_string_get(ptr, prop, buf);
@@ -4271,11 +4271,18 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
break;
case PROP_STRING:
{
- /* string arrays dont exist */
+ char *buf_esc;
char *buf;
- buf = RNA_property_string_get_alloc(ptr, prop, NULL, -1);
- BLI_dynstr_appendf(dynstr, "\"%s\"", buf);
+ int length;
+
+ length= RNA_property_string_length(ptr, prop);
+ buf= MEM_mallocN(sizeof(char)*(length+1), "RNA_property_as_string");
+ buf_esc= MEM_mallocN(sizeof(char)*(length*2+1), "RNA_property_as_string esc");
+ RNA_property_string_get(ptr, prop, buf);
+ BLI_strescape(buf_esc, buf, length*2);
MEM_freeN(buf);
+ BLI_dynstr_appendf(dynstr, "\"%s\"", buf_esc);
+ MEM_freeN(buf_esc);
break;
}
case PROP_ENUM: