In src/document.c:
> { > ui_set_statusbar(TRUE, "%s", err->message); > g_error_free(err); > return FALSE; > } > > - filedata->len = (gsize) st.st_size;
@b4n Maybe I miss something but right now (without my patch):
https://github.com/geany/geany/blob/master/src/document.c#L963
https://github.com/geany/geany/blob/master/src/encodings.c#L1082
https://github.com/geany/geany/blob/master/src/encodings.c#L1029
The thing is we need both the stat() value and strlen() value in order to do what's done in (3). Right now, my patch discards the stat() value which causes that the buffer->len != buffer->size check is equivalent to FALSE.
In the commit I mentioned the size was just moved into encodings.c but the two values are still there.
So I think this is something that should be fixed in my patch - personally I'd move the stat call inside handle_buffer() because passing the size value from somewhere else is a bit misleading (I at least assumed it was the size of the string which isn't the case).
What do you think?
—
Reply to this email directly or view it on GitHub.