diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-04 12:32:12 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-04 12:32:12 +0300 |
commit | 14d845192a8b967faed42c4e6e9cea1622f2bc01 (patch) | |
tree | 58f7c4d5886c4cfe4fa3266d10e7982629d85586 | |
parent | e7ba34599c64ddd5fbbbf11caf630bc068ff06fd (diff) | |
parent | 79e94caa6bf9fac819f7ba1c225adaf7bb67ec87 (diff) |
Merge branch 'blender-v3.2-release'
-rw-r--r-- | source/blender/editors/space_text/text_ops.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 753f82e483e..05d51cf6362 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -97,8 +97,9 @@ static char text_closing_character_pair_get(const char character) * This function converts the indentation tabs from a buffer to spaces. * \param in_buf: A pointer to a cstring. * \param tab_size: The size, in spaces, of the tab character. + * \param r_out_buf_len: The #strlen of the returned buffer. */ -static char *buf_tabs_to_spaces(const char *in_buf, const int tab_size) +static char *buf_tabs_to_spaces(const char *in_buf, const int tab_size, int *r_out_buf_len) { /* Get the number of tab characters in buffer. */ bool line_start = true; @@ -148,6 +149,7 @@ static char *buf_tabs_to_spaces(const char *in_buf, const int tab_size) } out_buf[out_offset] = '\0'; + *r_out_buf_len = out_offset; return out_buf; } @@ -916,7 +918,7 @@ static int text_paste_exec(bContext *C, wmOperator *op) /* Convert clipboard content indentation to spaces if specified */ if (text->flags & TXT_TABSTOSPACES) { - char *new_buf = buf_tabs_to_spaces(buf, TXT_TABSIZE); + char *new_buf = buf_tabs_to_spaces(buf, TXT_TABSIZE, &buf_len); MEM_freeN(buf); buf = new_buf; } |