diff options
author | Joerg Mueller <nexyon@gmail.com> | 2011-08-30 12:22:03 +0400 |
---|---|---|
committer | Joerg Mueller <nexyon@gmail.com> | 2011-08-30 12:22:03 +0400 |
commit | 43ab8e86247b7889d16d915b4f370ceb618aaad4 (patch) | |
tree | 64b1fec1adcc399eb1de5cd86ebafd753a921d8d /source/blender/makesrna/intern/rna_access.c | |
parent | 5b5e600db6f529ad7e1af9d4bb3a193be2265342 (diff) | |
parent | d049a722fea3d150fbfad06ffdbbb5c150717134 (diff) |
* Merge trunk up to r39790.soc-2011-pepper
* Subversion bump (also for init_userdef_do_versions).
* Minor fix for compilation without ffmpeg.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 15 |
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 127b27f2e18..0d4e31cdaf2 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2214,7 +2214,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); @@ -4379,11 +4379,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: |