diff options
Diffstat (limited to 'source/blender/python/generic/bpy_internal_import.c')
-rw-r--r-- | source/blender/python/generic/bpy_internal_import.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c index 88e2da16eb5..d9183261329 100644 --- a/source/blender/python/generic/bpy_internal_import.c +++ b/source/blender/python/generic/bpy_internal_import.c @@ -141,9 +141,10 @@ PyObject *bpy_text_import_name(const char *name, int *found) printf("ERROR: bpy_import_main_set() was not called before running python. this is a bug.\n"); return NULL; } - - if (namelen >= (MAX_ID_NAME-2) - 3) return NULL; /* we know this cant be importable, the name is too long for blender! */ - + + /* we know this cant be importable, the name is too long for blender! */ + if (namelen >= (MAX_ID_NAME-2) - 3) return NULL; + memcpy(txtname, name, namelen); memcpy(&txtname[namelen], ".py", 4); |