I had a quick look at what we have for loading, and indeed it's a mess at least 
in that area.  I'll try and have a stab at cleaning it up a tiny bit and avoid 
the loading of partial files without notifying.  And I think we should probably 
*not* load truncated files, even if we'd warn better (and for that I think an 
infobar would indeed be better than a dialog that is skipped on startup), 
because it's just bound to loose data.

For the "file with NULs" case, I think there are only 3 options:
1) NOT open them at all and notify why that didn't open
2) open them read-only *including the NUL bytes* and *warn a **lot*** (possibly 
even preventing passing them non-read-only) -- here @elextr is worried it'd 
break a lot more things, I don't know if it's true if we don't allow editing, 
although possibly some features would be partly non-working indeed (but I don't 
expect crashes though)
3) as mentioned, fix all of Geany and plugins to properly handle NULs -- which 
is definitely doable, although a lot of work, and tricky to make it a bit 
foolproof not to risk introduce issues in the future too easily (which will 
anyway be a bit tricky, the C library not being very helpful there)

But again, I don't think having (partly working) code for "load truncated but 
read-only the user can choose to ignore" is a very good idea, especially as the 
warning can sometimes (even without a bug) be hard to notice.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/3700#issuecomment-1826387853
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/issues/3700/1826387...@github.com>

Reply via email to