forked from bartvdbraak/blender
fix [#25778] Memoryblock Data from SCR: end corrupt
+ other minor changes.
This commit is contained in:
parent
8e83dd0933
commit
27cb6218a3
@ -5279,7 +5279,11 @@ static void direct_link_screen(FileData *fd, bScreen *sc)
|
|||||||
for(cl= sconsole->history.first; cl; cl= cl_next) {
|
for(cl= sconsole->history.first; cl; cl= cl_next) {
|
||||||
cl_next= cl->next;
|
cl_next= cl->next;
|
||||||
cl->line= newdataadr(fd, cl->line);
|
cl->line= newdataadr(fd, cl->line);
|
||||||
if (cl->line == NULL) {
|
if (cl->line) {
|
||||||
|
/* the allocted length is not written, so reset here */
|
||||||
|
cl->len_alloc= cl->len + 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
BLI_remlink(&sconsole->history, cl);
|
BLI_remlink(&sconsole->history, cl);
|
||||||
MEM_freeN(cl);
|
MEM_freeN(cl);
|
||||||
}
|
}
|
||||||
|
@ -2139,6 +2139,7 @@ static void write_screens(WriteData *wd, ListBase *scrbase)
|
|||||||
ConsoleLine *cl;
|
ConsoleLine *cl;
|
||||||
|
|
||||||
for (cl=con->history.first; cl; cl=cl->next) {
|
for (cl=con->history.first; cl; cl=cl->next) {
|
||||||
|
/* 'len_alloc' is invalid on write, set from 'len' on read */
|
||||||
writestruct(wd, DATA, "ConsoleLine", 1, cl);
|
writestruct(wd, DATA, "ConsoleLine", 1, cl);
|
||||||
writedata(wd, DATA, cl->len+1, cl->line);
|
writedata(wd, DATA, cl->len+1, cl->line);
|
||||||
}
|
}
|
||||||
|
@ -1071,7 +1071,6 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
|
|||||||
case PROP_STRING:
|
case PROP_STRING:
|
||||||
{
|
{
|
||||||
const char *param;
|
const char *param;
|
||||||
Py_ssize_t param_size= 0;
|
|
||||||
#ifdef USE_STRING_COERCE
|
#ifdef USE_STRING_COERCE
|
||||||
PyObject *value_coerce= NULL;
|
PyObject *value_coerce= NULL;
|
||||||
int subtype= RNA_property_subtype(prop);
|
int subtype= RNA_property_subtype(prop);
|
||||||
@ -1080,10 +1079,10 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
|
|||||||
param= PyC_UnicodeAsByte(value, &value_coerce);
|
param= PyC_UnicodeAsByte(value, &value_coerce);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
param= _PyUnicode_AsStringAndSize(value, ¶m_size);
|
param= _PyUnicode_AsString(value);
|
||||||
}
|
}
|
||||||
#else // USE_STRING_COERCE
|
#else // USE_STRING_COERCE
|
||||||
param= _PyUnicode_AsStringAndSize(value, ¶m_size);
|
param= _PyUnicode_AsStringSize(value);
|
||||||
#endif // USE_STRING_COERCE
|
#endif // USE_STRING_COERCE
|
||||||
|
|
||||||
if (param==NULL) {
|
if (param==NULL) {
|
||||||
|
@ -48,6 +48,8 @@ def file_list_py(path):
|
|||||||
|
|
||||||
def is_pep8(path):
|
def is_pep8(path):
|
||||||
print(path)
|
print(path)
|
||||||
|
if open(path, 'rb').read(3) == b'\xef\xbb\xbf':
|
||||||
|
print("\nfile contains BOM, remove first 3 bytes: %r\n" % path)
|
||||||
f = open(path, 'r', encoding="utf8")
|
f = open(path, 'r', encoding="utf8")
|
||||||
for i in range(PEP8_SEEK_COMMENT):
|
for i in range(PEP8_SEEK_COMMENT):
|
||||||
line = f.readline()
|
line = f.readline()
|
||||||
|
Loading…
Reference in New Issue
Block a user