diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/python/generic/bpy_internal_import.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index d3b8b19693f..002467687c4 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -74,8 +74,9 @@ PyObject *bpy_text_import( Text *text ) } } - len= strlen(text->id.name+2) - 3; + len= strlen(text->id.name+2); strncpy(modulename, text->id.name+2, len); + modulename[len - 3]= '\0'; /* remove .py */ return PyImport_ExecCodeModule(modulename, text->compiled); } |