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:
authorCampbell Barton <campbell@blender.org>2022-03-11 07:09:55 +0300
committerCampbell Barton <campbell@blender.org>2022-03-11 07:14:14 +0300
commit8cc5483331d1a3d5c6eba055ae303788ba843526 (patch)
tree0b132608148bd35d7aad85b760d35300b9c94102 /source/blender/python
parent231eac160ee394d41c84e0cc36845facb7594ba5 (diff)
Text: use simplified logic for txt_to_buf
This function was copied from txt_sel_to_buf, including unnecessary complexity to support selection as well as checks for the cursor which don't make sense when copying the whole buffer. Use a simple loop to copy all text into the destination buffer.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_interface_run.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_interface_run.c b/source/blender/python/intern/bpy_interface_run.c
index 01db0efecfd..500221c3c50 100644
--- a/source/blender/python/intern/bpy_interface_run.c
+++ b/source/blender/python/intern/bpy_interface_run.c
@@ -102,7 +102,8 @@ static bool python_script_exec(
fn_dummy_py = PyC_UnicodeFromByte(fn_dummy);
- buf = txt_to_buf(text, NULL);
+ int buf_len_dummy;
+ buf = txt_to_buf(text, &buf_len_dummy);
text->compiled = Py_CompileStringObject(buf, fn_dummy_py, Py_file_input, NULL, -1);
MEM_freeN(buf);