diff options
Diffstat (limited to 'source/blender/python/generic/bpy_internal_import.c')
-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 957a4e6f52d..2fd44b0f6f5 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); } |