- string copy without .py wasnt terminating the string

- console import autocomplete wasnt including modules defined in C like BGL, Mathutils
This commit is contained in:
2009-12-07 14:09:53 +00:00
parent 73fbc0f02d
commit 926201acf8
2 changed files with 6 additions and 2 deletions

View File

@@ -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);
}