Menu

#124 text editor fails to save a 1-byte length text file (becomes 0 bytes)

v1.0_(example)
open
nobody
None
1
2026-07-12
2026-07-12
bughunter2
No

If we use Ghost Commander's text editor to create a text file with a single character like a '.' or 'a' (ignore the quotes), it gets saved as an empty file instead (0 bytes instead of 1 byte). Note that the filename is irrelevant (it's about its contents).

But if the text editor contains at least two characters, like '..' or 'ab', the file is saved correctly (2 bytes).

It's a small problem that I happened to stumble upon. Just letting you know about it.

Maybe this is a simple off-by-one error, whereby the editor's contents are only saved if the buffer length is > 1, rather than > 0?

Discussion


Log in to post a comment.