From 852a03a6af6d67da58154b848b45a118eb38cdc0 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 28 Aug 2011 09:28:41 +0000 Subject: RNA_property_as_string now escapes the string (so operator redo can include strings with ", \n etc), also fixed a bug in string escape length limit. --- source/blender/blenlib/intern/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/blenlib/intern/string.c') diff --git a/source/blender/blenlib/intern/string.c b/source/blender/blenlib/intern/string.c index 2f1ddf294ce..c4ed44f0cdb 100644 --- a/source/blender/blenlib/intern/string.c +++ b/source/blender/blenlib/intern/string.c @@ -129,7 +129,6 @@ size_t BLI_strescape(char *dst, const char *src, const size_t maxlen) while(len < maxlen) { switch(*src) { case '\0': - *dst= '\0'; break; case '\\': case '"': @@ -144,7 +143,6 @@ size_t BLI_strescape(char *dst, const char *src, const size_t maxlen) } else { /* not enough space to escape */ - *dst= '\0'; break; } /* intentionally pass through */ @@ -156,6 +154,8 @@ size_t BLI_strescape(char *dst, const char *src, const size_t maxlen) len++; } + *dst= '\0'; + return len; } -- cgit v1.2.3